Class OAuth2AuthorizeRequest
java.lang.Object
org.springframework.security.oauth2.client.OAuth2AuthorizeRequest
Represents a request the
OAuth2AuthorizedClientManager
uses to
authorize
(or
re-authorize) the client
identified by the provided
clientRegistrationId
.- Since:
- 5.2
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
getAttribute
(String name) Returns the value of an attribute associated to the request ornull
if not available.Returns the attributes associated to the request.Returns theauthorized client
ornull
if it was not provided.Returns the identifier for theclient registration
.Returns thePrincipal
(to be) associated to the authorized client.withAuthorizedClient
(OAuth2AuthorizedClient authorizedClient) Returns a newOAuth2AuthorizeRequest.Builder
initialized with theauthorized client
.withClientRegistrationId
(String clientRegistrationId) Returns a newOAuth2AuthorizeRequest.Builder
initialized with the identifier for theclient registration
.
-
Method Details
-
getClientRegistrationId
Returns the identifier for theclient registration
.- Returns:
- the identifier for the client registration
-
getAuthorizedClient
Returns theauthorized client
ornull
if it was not provided.- Returns:
- the
OAuth2AuthorizedClient
ornull
if it was not provided
-
getPrincipal
Returns thePrincipal
(to be) associated to the authorized client.- Returns:
- the
Principal
(to be) associated to the authorized client
-
getAttributes
Returns the attributes associated to the request.- Returns:
- a
Map
of the attributes associated to the request
-
getAttribute
Returns the value of an attribute associated to the request ornull
if not available.- Type Parameters:
T
- the type of the attribute- Parameters:
name
- the name of the attribute- Returns:
- the value of the attribute associated to the request
-
withClientRegistrationId
Returns a newOAuth2AuthorizeRequest.Builder
initialized with the identifier for theclient registration
.- Parameters:
clientRegistrationId
- the identifier for theclient registration
- Returns:
- the
OAuth2AuthorizeRequest.Builder
-
withAuthorizedClient
public static OAuth2AuthorizeRequest.Builder withAuthorizedClient(OAuth2AuthorizedClient authorizedClient) Returns a newOAuth2AuthorizeRequest.Builder
initialized with theauthorized client
.- Parameters:
authorizedClient
- theauthorized client
- Returns:
- the
OAuth2AuthorizeRequest.Builder
-