Class OAuth2AuthorizeRequest.Builder
- java.lang.Object
-
- org.springframework.security.oauth2.client.OAuth2AuthorizeRequest.Builder
-
- Enclosing class:
- OAuth2AuthorizeRequest
public static final class OAuth2AuthorizeRequest.Builder extends java.lang.Object
A builder forOAuth2AuthorizeRequest
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AuthorizeRequest.Builder
attribute(java.lang.String name, java.lang.Object value)
Sets an attribute associated to the request.OAuth2AuthorizeRequest.Builder
attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Provides aConsumer
access to the attributes associated to the request.OAuth2AuthorizeRequest
build()
Builds a newOAuth2AuthorizeRequest
.OAuth2AuthorizeRequest.Builder
principal(java.lang.String principalName)
Sets the name of thePrincipal
(to be) associated to the authorized client.OAuth2AuthorizeRequest.Builder
principal(Authentication principal)
Sets thePrincipal
(to be) associated to the authorized client.
-
-
-
Method Detail
-
principal
public OAuth2AuthorizeRequest.Builder principal(java.lang.String principalName)
Sets the name of thePrincipal
(to be) associated to the authorized client.- Parameters:
principalName
- the name of thePrincipal
(to be) associated to the authorized client- Returns:
- the
OAuth2AuthorizeRequest.Builder
- Since:
- 5.3
-
principal
public OAuth2AuthorizeRequest.Builder principal(Authentication principal)
Sets thePrincipal
(to be) associated to the authorized client.- Parameters:
principal
- thePrincipal
(to be) associated to the authorized client- Returns:
- the
OAuth2AuthorizeRequest.Builder
-
attributes
public OAuth2AuthorizeRequest.Builder attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Provides aConsumer
access to the attributes associated to the request.- Parameters:
attributesConsumer
- aConsumer
of the attributes associated to the request- Returns:
- the
OAuth2AuthorizeRequest.Builder
-
attribute
public OAuth2AuthorizeRequest.Builder attribute(java.lang.String name, java.lang.Object value)
Sets an attribute associated to the request.- Parameters:
name
- the name of the attributevalue
- the value of the attribute- Returns:
- the
OAuth2AuthorizeRequest.Builder
-
build
public OAuth2AuthorizeRequest build()
Builds a newOAuth2AuthorizeRequest
.- Returns:
- a
OAuth2AuthorizeRequest
-
-