-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix client authn request parameter name #236
Conversation
We should probably add a note in the Wiki/README, telling users that if their client is not public and if they use a generic OIDC Provider they MUST register the client to use the |
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.
Thanks for the fix and also for fixing the linked OAuth2 issue, golang/oauth2#685 makes a lot more sense! 😄
I assume this is the section in the spec which defines the client_secret
parameter, right? Could you link to that in the comment please?
That section says that HTTP Basic authentication should be preferred over passing the client secret in a URL parameter, which made we wonder if we should support that instead. I looked at what the oauth2 package does (in the cases where it does use the client secret), and it tries both basic auth and URL parameters (and caches which one worked), see https://github.com/golang/oauth2/blob/22134a41033e44c2cd074106770ab5b7ca910d15/internal/token.go#L228-L239.
I don't understand this comment. What do you mean with "register the client"? |
/cc @shipperizer |
e9f19e5
to
3d27d8d
Compare
On most providers when you create (register) a client, to get the Right now our code works only if the client authentication method is
The problem is that we are allowed to add extra url params when calling the |
Any news on this? |
Sorry, it was a busy week and this PR fell through the cracks. To increase visibility, re-requesting the review would help (but I also repeatedly forget to do that myself, I wish the GitHub UI would make it more obvious whose action is required).
Thanks for explaining. I assume many identity providers don't support this option at all, and that documenting this in a generic way ("register the client to use the client_secret_post method") would be more confusing to users than it would help. Do you have examples of specific providers which can/need to be configured that way? If so, we could document it explicitly for those providers.
It doesn't sound that intrusive to me to add a custom HTTP client to the context which adds the extra headers. We don't have to do it now, but I suspect that we have to do it eventually. So to prepare for that case, I would like us to add a comment that explains that:
What do you think? |
3d27d8d
to
053b83a
Compare
Don't worry, I understand the struggle. I always forget to re-request the review myself, I will try to remember it next time.
What you say makes sense in general, but let me clarify some things to be sure that we are on the same page:
Regarding patching the HTTP client, my main concern is that the code would be to messy, especially if implementing the client authentication method discovery that the oauth2 lib supports. I agree with leaving it as it is for now and keeping it in the backlog as something that we may have to implement if someone requests it. I have updated the comment, please let me know if it makes sense to you now. NOTE: As you said the oauth2 RFC states that
TBH I am not sure if we should care about any of those 2 claims. |
Thanks for the additional context. I think it makes sense to reconsider supporting additional authentication methods once they are requested by users.
Looks good, thanks! One last thing: You said in your first comment that you tested this against a generic OIDC provider. Which one is that? Just so that it's clear which providers we already tested (and which we might want to test again if we change this part of code again). |
I tested against google (but they don't support refresh tokens for the device flow) and against our identity platform deployed at https://iam.dev.canonical.com/stg-identity-jaas-dev-hydra/.well-known/openid-configuration (which uses Ory Hydra) using the generic implementation. |
Great, I added that to the code comment. |
The previous PR had a typo. I tested it against a generic OIDC provider and it now works.
Disclaimer: This logic works for only 1 (
client_secret_post
) out of the 2 most common client authentication methods (for a list of all the client authn methods see here). I am not sure if there is a way to make it work for any of the other methods using the std go oauth2 lib.