-
Notifications
You must be signed in to change notification settings - Fork 6k
Add OAuth2AuthorizationRequestResolver #4911
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
Comments
@andersonkyle Makes sense. We'll aim to add this for 5.1 |
@andersonkyle I'm finally circling back to address this requirement. The simplest solution to allow for custom authorization request parameters would be to allow the user to provide the request parameters via the For example, if you would like to provide the
We would ensure that any request parameters supplied in the Would this strategy meet your requirement? |
Yeah, that should do the trick. Thanks! The same flexibility is needed for the token request:
^ the above example This may be worthy of a separate ticket but thought I'd mention it while you're looking at this. Both of these improvements will make working with 3rd party providers (who love to add functionality on top of the spec) much easier! |
@andersonkyle Yes, please add a new ticket for the custom token request parameters. I'll keep this in mind. |
@jgrandja Thought about the proposal a little more and while it works for simple use cases, it doesn't allow the values to be dynamic. Here's an example: A Client has access to multiple identity providers (Active Directory, Google and Okta's Universal Directory). The additional Perhaps a callback mechanism would work a little better? |
@andersonkyle Ok. I'll ensure a hook is provided that will allow for dynamic parameters. |
Hi, Maybe I shouldn't be using Security OAauth to do this (as the API say that they use a "variant of OAuth2") but: I'm trying to use the Pocket API and they request just requires the "consumer_key" and "redirect_url" to get the token. As pointed out by @andersonkyle would be good to customize the URI and add parameters, but also remove unnecessary. When I'm creating a ClientRegistration the builder forces me to set some parameters that are not mandatory to this specific API. If I did not provide enough information, please just let me know. |
@andersonkyle This feature has been merged. Take a look at the following tests for usage: Line 306 in 779597a
Line 337 in 779597a
Also, I'm planning on merging #5521 shortly as this is required in order to configure a custom Please let me know how this goes and if it suits your requirements. |
@jgrandja This looks great. This additional flexibility makes it simple to satisfy any OAuth provider's specific requirements. 👍 |
Yeah I'm pretty happy how it turned out. The |
…ing) Previously there was a tangle between DefaultOAuth2AuthorizationRequestResolver and OAuth2AuthorizationRequestRedirectFilter with AUTHORIZATION_REQUIRED_EXCEPTION_ATTR_NAME This commit adds a new method that can be used for resolving the OAuth2AuthorizationRequest when the client registration id is known. Issue: gh-4911
@jgrandja @andersonkyle I put some polish on this code to remove a tangle. See 938dbbf |
Summary
When using a 3rd party OAuth provider such as Auth0 or Okta it would be very useful to allow developers to hook into the Authorization Request URI build process in order to add custom query parameters. This is because the providers mentioned above have added additional parameters on top of the specification to allow for more functionality.
Examples
Auth0
audience: The unique identifier of the target API you want to access.
This parameter impacts the format of the access token
Okta
idp: The Identity provider used to do the authentication.
This parameter instructs Okta to either use itself as the Identity Provider or to use another identity provider connected to the Okta Authorization Server.
A simple hook into the building of the URI should provide sufficient flexibility for these custom parameters and any others that are introduced in the future.
The text was updated successfully, but these errors were encountered: