Skip to content

Return all parameters for non authorization-code flow requests #800

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

Closed
sarahwalther opened this issue Jul 11, 2022 · 4 comments
Closed

Return all parameters for non authorization-code flow requests #800

sarahwalther opened this issue Jul 11, 2022 · 4 comments
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@sarahwalther
Copy link
Contributor

Expected Behavior
Returned tokens, such as OAuth2AuthorizationCodeAuthenticationToken, should include the same data in the additional parameters field as OAuth2ClientAuthenticationToken.

Current Behavior
Currently, for non authorization-code flow requests, additional parameters get removed and an empty map is returned

Context
In the failure case, we would like to log all non-user identifying information, such as grant_type and scopes to make de-bugging easier. Currently, as a workaround, we are fetching this data from our implementation of the OAuth2AuthorizationService. This gives us what we want, but is some additional work and could slow the process down.

@sarahwalther sarahwalther added the type: enhancement A general enhancement label Jul 11, 2022
@sjohnr
Copy link
Member

sjohnr commented Jul 15, 2022

Related gh-159

@jgrandja
Copy link
Collaborator

jgrandja commented Jul 19, 2022

@sarahwalther

OAuth2AuthorizationCodeAuthenticationToken should include the same data in the additional parameters field as OAuth2ClientAuthenticationToken

OAuth2AuthorizationCodeAuthenticationToken is an authorization grant token, whereas, OAuth2ClientAuthenticationToken is a token representing a client authentication request. The 2 flows and related parameters are different so the currently populated attributes are correct.

In the failure case, we would like to log all non-user identifying information

If you're looking to log additional information when a client authentication fails, then you have access to all the parameters via the HttpServletRequest that is supplied to OAuth2ClientAuthenticationFilter.setAuthenticationFailureHandler(). See the reference documentation on how to configure a custom AuthenticationFailureHandler.

Does this work for you?

@jgrandja jgrandja added the status: waiting-for-feedback We need additional information before we can continue label Jul 19, 2022
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jul 26, 2022
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Aug 2, 2022
@jgrandja jgrandja self-assigned this Aug 2, 2022
@jgrandja jgrandja added status: declined A suggestion or change that we don't feel we should currently apply and removed type: enhancement A general enhancement labels Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

4 participants