Class ClientRegistration.Builder
- java.lang.Object
-
- org.springframework.security.oauth2.client.registration.ClientRegistration.Builder
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- ClientRegistration
public static class ClientRegistration.Builder extends java.lang.Object implements java.io.Serializable
A builder forClientRegistration
.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientRegistration.Builder
authorizationGrantType(AuthorizationGrantType authorizationGrantType)
Sets theauthorization grant type
used for the client.ClientRegistration.Builder
authorizationUri(java.lang.String authorizationUri)
Sets the uri for the authorization endpoint.ClientRegistration
build()
Builds a newClientRegistration
.ClientRegistration.Builder
clientAuthenticationMethod(ClientAuthenticationMethod clientAuthenticationMethod)
Sets theauthentication method
used when authenticating the client with the authorization server.ClientRegistration.Builder
clientId(java.lang.String clientId)
Sets the client identifier.ClientRegistration.Builder
clientName(java.lang.String clientName)
Sets the logical name of the client or registration.ClientRegistration.Builder
clientSecret(java.lang.String clientSecret)
Sets the client secret.ClientRegistration.Builder
jwkSetUri(java.lang.String jwkSetUri)
Sets the uri for the JSON Web Key (JWK) Set endpoint.ClientRegistration.Builder
providerConfigurationMetadata(java.util.Map<java.lang.String,java.lang.Object> configurationMetadata)
Sets the metadata describing the provider's configuration.ClientRegistration.Builder
redirectUriTemplate(java.lang.String redirectUriTemplate)
Sets the uri (or uri template) for the redirection endpoint.ClientRegistration.Builder
registrationId(java.lang.String registrationId)
Sets the registration id.ClientRegistration.Builder
scope(java.lang.String... scope)
Sets the scope(s) used for the client.ClientRegistration.Builder
scope(java.util.Collection<java.lang.String> scope)
Sets the scope(s) used for the client.ClientRegistration.Builder
tokenUri(java.lang.String tokenUri)
Sets the uri for the token endpoint.ClientRegistration.Builder
userInfoAuthenticationMethod(AuthenticationMethod userInfoAuthenticationMethod)
Sets the authentication method for the user info endpoint.ClientRegistration.Builder
userInfoUri(java.lang.String userInfoUri)
Sets the uri for the user info endpoint.ClientRegistration.Builder
userNameAttributeName(java.lang.String userNameAttributeName)
Sets the attribute name used to access the user's name from the user info response.
-
-
-
Method Detail
-
registrationId
public ClientRegistration.Builder registrationId(java.lang.String registrationId)
Sets the registration id.- Parameters:
registrationId
- the registration id- Returns:
- the
ClientRegistration.Builder
-
clientId
public ClientRegistration.Builder clientId(java.lang.String clientId)
Sets the client identifier.- Parameters:
clientId
- the client identifier- Returns:
- the
ClientRegistration.Builder
-
clientSecret
public ClientRegistration.Builder clientSecret(java.lang.String clientSecret)
Sets the client secret.- Parameters:
clientSecret
- the client secret- Returns:
- the
ClientRegistration.Builder
-
clientAuthenticationMethod
public ClientRegistration.Builder clientAuthenticationMethod(ClientAuthenticationMethod clientAuthenticationMethod)
Sets theauthentication method
used when authenticating the client with the authorization server.- Parameters:
clientAuthenticationMethod
- the authentication method used for the client- Returns:
- the
ClientRegistration.Builder
-
authorizationGrantType
public ClientRegistration.Builder authorizationGrantType(AuthorizationGrantType authorizationGrantType)
Sets theauthorization grant type
used for the client.- Parameters:
authorizationGrantType
- the authorization grant type used for the client- Returns:
- the
ClientRegistration.Builder
-
redirectUriTemplate
public ClientRegistration.Builder redirectUriTemplate(java.lang.String redirectUriTemplate)
Sets the uri (or uri template) for the redirection endpoint.- Parameters:
redirectUriTemplate
- the uri for the redirection endpoint- Returns:
- the
ClientRegistration.Builder
-
scope
public ClientRegistration.Builder scope(java.lang.String... scope)
Sets the scope(s) used for the client.- Parameters:
scope
- the scope(s) used for the client- Returns:
- the
ClientRegistration.Builder
-
scope
public ClientRegistration.Builder scope(java.util.Collection<java.lang.String> scope)
Sets the scope(s) used for the client.- Parameters:
scope
- the scope(s) used for the client- Returns:
- the
ClientRegistration.Builder
-
authorizationUri
public ClientRegistration.Builder authorizationUri(java.lang.String authorizationUri)
Sets the uri for the authorization endpoint.- Parameters:
authorizationUri
- the uri for the authorization endpoint- Returns:
- the
ClientRegistration.Builder
-
tokenUri
public ClientRegistration.Builder tokenUri(java.lang.String tokenUri)
Sets the uri for the token endpoint.- Parameters:
tokenUri
- the uri for the token endpoint- Returns:
- the
ClientRegistration.Builder
-
userInfoUri
public ClientRegistration.Builder userInfoUri(java.lang.String userInfoUri)
Sets the uri for the user info endpoint.- Parameters:
userInfoUri
- the uri for the user info endpoint- Returns:
- the
ClientRegistration.Builder
-
userInfoAuthenticationMethod
public ClientRegistration.Builder userInfoAuthenticationMethod(AuthenticationMethod userInfoAuthenticationMethod)
Sets the authentication method for the user info endpoint.- Parameters:
userInfoAuthenticationMethod
- the authentication method for the user info endpoint- Returns:
- the
ClientRegistration.Builder
- Since:
- 5.1
-
userNameAttributeName
public ClientRegistration.Builder userNameAttributeName(java.lang.String userNameAttributeName)
Sets the attribute name used to access the user's name from the user info response.- Parameters:
userNameAttributeName
- the attribute name used to access the user's name from the user info response- Returns:
- the
ClientRegistration.Builder
-
jwkSetUri
public ClientRegistration.Builder jwkSetUri(java.lang.String jwkSetUri)
Sets the uri for the JSON Web Key (JWK) Set endpoint.- Parameters:
jwkSetUri
- the uri for the JSON Web Key (JWK) Set endpoint- Returns:
- the
ClientRegistration.Builder
-
providerConfigurationMetadata
public ClientRegistration.Builder providerConfigurationMetadata(java.util.Map<java.lang.String,java.lang.Object> configurationMetadata)
Sets the metadata describing the provider's configuration.- Parameters:
configurationMetadata
- the metadata describing the provider's configuration- Returns:
- the
ClientRegistration.Builder
- Since:
- 5.1
-
clientName
public ClientRegistration.Builder clientName(java.lang.String clientName)
Sets the logical name of the client or registration.- Parameters:
clientName
- the client or registration name- Returns:
- the
ClientRegistration.Builder
-
build
public ClientRegistration build()
Builds a newClientRegistration
.- Returns:
- a
ClientRegistration
-
-