-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added authorize endpoint as specified by rfc6549 authorization code #2626
added authorize endpoint as specified by rfc6549 authorization code #2626
Conversation
|
efe8242
to
f32b958
Compare
auth/api/iam/openid4vp.go
Outdated
} | ||
metadata, err := r.auth.Verifier().AuthorizationServerMetadata(ctx, *walletDID) | ||
if err != nil { | ||
return nil, oauthError(oauth.ServerError, "failed to get authorization server metadata (holder)", redirectURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verifier, Wallet, Holder? Too many roles/concepts mixed here
callbackURL := *ownURL | ||
callbackURL.Path, err = url.JoinPath(callbackURL.Path, "response") | ||
if err != nil { | ||
return nil, oauthError(oauth.ServerError, "failed to construct redirect path", redirectURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can ever occur?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's hope not
"github.com/nuts-foundation/nuts-node/auth/oauth" | ||
) | ||
|
||
var _ Verifier = (*VerifierServiceProvider)(nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect a Verifier, which is from OpenID4VP, to be in an OpenID4VP package? Otherwise, we might have to prefix the type name with something that indicates the protocol/spec/domain? E.g. PresentationVerifier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to complete the entire flow first and then see if stuff needs to move.
// Verifier implements the OpenID4VP Verifier role. | ||
type Verifier interface { | ||
// AuthorizationServerMetadata returns the metadata of the remote wallet. | ||
AuthorizationServerMetadata(ctx context.Context, webdid did.DID) (*oauth.AuthorizationServerMetadata, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not OpenID4VP-specific, so I'd expect this to be in a more generic OAuth2 type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, but currently it's closer related to things the verifier needs/has. Let's also park this till the end.
RedirectURI: redirectURL.String(), | ||
} | ||
// use nonce to store authorization request in session store | ||
if err = r.oauthNonceStore().Put(nonce, openid4vpRequest); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be client state instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both probably, but this automatically emerges in the next PR because there it's needed!
846b256
to
9d1f337
Compare
9d1f337
to
3b47e20
Compare
…2626) wip added bunch of tests added missing API tests fix failing test add tests for failing directpost responses refactor ami client and reuse response parsing/code checking happy flow tests for holder service error tests for holder service comment touchup on some comments
…2626) wip added bunch of tests added missing API tests fix failing test add tests for failing directpost responses refactor ami client and reuse response parsing/code checking happy flow tests for holder service error tests for holder service comment touchup on some comments
…2626) wip added bunch of tests added missing API tests fix failing test add tests for failing directpost responses refactor ami client and reuse response parsing/code checking happy flow tests for holder service error tests for holder service comment touchup on some comments
…2626) wip added bunch of tests added missing API tests fix failing test add tests for failing directpost responses refactor ami client and reuse response parsing/code checking happy flow tests for holder service error tests for holder service comment touchup on some comments fix didkey pattern remove url decode from middleware, now handled by codegen bind add callback, fix request logger fix logger test add e2e test added handling of error direct_post
* added authorize endpoint as specified by rfc6549 authorization code (#2626) * add e2e test
…2626) wip added bunch of tests added missing API tests fix failing test add tests for failing directpost responses refactor ami client and reuse response parsing/code checking happy flow tests for holder service error tests for holder service comment touchup on some comments fix didkey pattern remove url decode from middleware, now handled by codegen bind add callback, fix request logger fix logger test add e2e test added handling of error direct_post
closes #2625
I changed the expectation of did:nuts for OpenID4VP into did:web.
The PR might also remove some unused stuff....