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

OAuth2 request_type="code" scope="openid ..." is spuriously validating id_token #1561

Open
paul-hicks-mahana opened this issue Jun 27, 2024 · 2 comments
Labels
question Further information is requested

Comments

@paul-hicks-mahana
Copy link

I'm getting a validation error with a response from a plain OAuth2 (non-OIDC) AS. The request_type is "code" and I have the "openid" scope included. Line 43 of ResponseValidator is validating based on the openid scope, and part of that validation is to check that id_token is a valid JWT.

However, as per the example in the specs, the id_token response is mandatory only for request_type "id_token":
https://openid.net/specs/openid-connect-core-1_0.html#codeExample

I believe the validation should consider whether or not the request_type is "code"; if it is, it should only validate the format of id_token if it exists. It should not fail validation if it does not exist.

@pamapa pamapa added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Jun 28, 2024
@pamapa
Copy link
Member

pamapa commented Jun 28, 2024

Which Idp are you using? Typically when you set openid you get an id_token.

Why do you need to set scope=openid anyway when you do not need the id_token anyway?

@paul-hicks-mahana
Copy link
Author

paul-hicks-mahana commented Jul 2, 2024

Which Idp are you using? Typically when you set openid you get an id_token.

I'm using a service called WorkflowMax (oauth.workflowmax2.com).

Why do you need to set scope=openid anyway when you do not need the id_token anyway?

I'm learning as I go :) All the examples on WorkflowMax's site include the openid scope, so I used it.
I have now removed that scope and everything seems to be working. There are some oddities that may be because I've removed the openid scope, but I'm still learning in this area, so I can't yet say for sure.

That said, the example "A.1" on the openid site that I linked to in the original question is pretty clear: the openid scope is in the authorization request and id_token is not in the response. So it does seem to be completely valid to not have id_token included in the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants