Skip to content
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

Experimental Auth v2 API #2430

Merged
merged 15 commits into from
Aug 23, 2023
Merged

Experimental Auth v2 API #2430

merged 15 commits into from
Aug 23, 2023

Conversation

reinkrul
Copy link
Member

@reinkrul reinkrul commented Aug 18, 2023

Intended to incrementally implement the new OAuth2 flows (authz code, OpenID4VP, later on OpenID4VC).

It is disabled by default, config flag (auth.v2apienabled) hidden.

@reinkrul reinkrul marked this pull request as ready for review August 22, 2023 09:32
@reinkrul reinkrul changed the title Flexible OAuth2 Server POC Experimental Auth v2 API Aug 22, 2023
Copy link
Member

@gerardsn gerardsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments labeled comment are just comments ;)

it feels like the current separation in files is not the right one. the authorized_code flow can also be used with OpenID4VCI&VP, but those have their own files. I don't see a better separation at this point, so probably fine for now.

we're still missing the metadata endpoints (they are on /n2n, which means that public endpoints /authorize and /token can only be discovered on a non-public api...)

the pre-authorized_code flow is currently in the VCR, but should probably move here ?

return &result
}

type Session struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: RFC6749 3.1 Authorization Endpoint

Parameters sent without a value MUST be treated as if they were
omitted from the request. The authorization server MUST ignore
unrecognized request parameters. Request and response parameters
MUST NOT be included more than once.

Meaning param == "" can be interpreted as the parameter is not present in the authorization request

(just nothing this as confirmation that "" == nil in this case)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings can't be nil, so go helps here :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly, "" != nil but we can interpret it as such instead of using annoying *string

auth/api/auth/v2/s2s_vptoken.go Outdated Show resolved Hide resolved
docs/_static/auth/v2.yaml Outdated Show resolved Hide resolved
auth/api/auth/v2/api.go Outdated Show resolved Hide resolved
@reinkrul
Copy link
Member Author

comments labeled comment are just comments ;)

it feels like the current separation in files is not the right one. the authorized_code flow can also be used with OpenID4VCI&VP, but those have their own files. I don't see a better separation at this point, so probably fine for now.

I agree.

we're still missing the metadata endpoints (they are on /n2n, which means that public endpoints /authorize and /token can only be discovered on a non-public api...)

That's right, I'd suggest new metadata endpoints under /iam and move the VCI flows to this implementation later on.

the pre-authorized_code flow is currently in the VCR, but should probably move here ?

Later on, I'd say.

@reinkrul reinkrul requested a review from gerardsn August 22, 2023 13:11
@reinkrul reinkrul merged commit b9411e3 into master Aug 23, 2023
6 checks passed
@reinkrul reinkrul deleted the oauth2-server-poc2 branch August 23, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants