Skip to content

OAuth2AuthorizeRequest supports attributes #7352

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

Conversation

jgrandja
Copy link
Contributor

@jgrandja jgrandja commented Sep 4, 2019

Fixes gh-7341

@jgrandja jgrandja requested review from rwinch and jzheaux September 4, 2019 11:04
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement labels Sep 4, 2019
@jgrandja jgrandja added this to the 5.2.0.RC1 milestone Sep 4, 2019
@jgrandja
Copy link
Contributor Author

jgrandja commented Sep 4, 2019

@rwinch @jzheaux As you review this PR, please take note of the following key changes:

  • Moved OAuth2AuthorizeRequest, OAuth2AuthorizedClientManager and ServerOAuth2AuthorizedClientManager to base package org.springframework.security.oauth2.client
  • OAuth2AuthorizeRequest is reused for both OAuth2AuthorizedClientManager and ServerOAuth2AuthorizedClientManager
  • Default implementation class names remain the same - DefaultOAuth2AuthorizedClientManager and DefaultServerOAuth2AuthorizedClientManager. NOTE: The intention is to name the new implementation in OAuth2AuthorizedClientManager implementation works outside of request #7122 to OAuth2AuthorizedClientManagerService

Assert.notNull(authorizeRequest, "authorizeRequest cannot be null");

String clientRegistrationId = authorizeRequest.getClientRegistrationId();
Authentication principal = authorizeRequest.getPrincipal();
ServerWebExchange serverWebExchange = authorizeRequest.getServerWebExchange();

ServerWebExchange serverWebExchange = authorizeRequest.getAttribute(ServerWebExchange.class.getName());
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to default this, like you are doing on the servlet side.

@jgrandja
Copy link
Contributor Author

jgrandja commented Sep 6, 2019

Merged via a604468

@jgrandja jgrandja closed this Sep 6, 2019
@jgrandja jgrandja deleted the gh-7341-authz-req-attrs branch September 8, 2019 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth2AuthorizeRequest supports attributes
2 participants