Skip to content

Commit

Permalink
fix wrong refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst committed Dec 12, 2023
1 parent cf19f78 commit 3b47e20
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions auth/services/oauth/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
package oauth

import (
"context"
"crypto/tls"
"fmt"
"github.com/nuts-foundation/nuts-node/auth/client/iam"
"github.com/nuts-foundation/nuts-node/vdr/didweb"
"net/url"
"time"
Expand All @@ -47,6 +49,16 @@ func NewVerifier(strictMode bool, httpClientTimeout time.Duration, httpClientTLS
}
}

func (v *VerifierServiceProvider) AuthorizationServerMetadata(ctx context.Context, webdid did.DID) (*oauth.AuthorizationServerMetadata, error) {
iamClient := iam.NewHTTPClient(v.strictMode, v.httpClientTimeout, v.httpClientTLS)
// the wallet/holder acts as authorization server
metadata, err := iamClient.OAuthAuthorizationServerMetadata(ctx, webdid)
if err != nil {
return nil, fmt.Errorf("failed to retrieve remote OAuth Authorization Server metadata: %w", err)
}
return metadata, nil
}

func (v *VerifierServiceProvider) ClientMetadataURL(webdid did.DID) (*url.URL, error) {
didURL, err := didweb.DIDToURL(webdid)
if err != nil {
Expand Down

0 comments on commit 3b47e20

Please sign in to comment.