Class RegisteredClient.Builder
java.lang.Object
org.springframework.security.oauth2.server.authorization.client.RegisteredClient.Builder
- All Implemented Interfaces:
Serializable
- Enclosing class:
- RegisteredClient
A builder for
RegisteredClient
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthorizationGrantType
(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType) Adds anauthorization grant type
the client may use.authorizationGrantTypes
(Consumer<Set<org.springframework.security.oauth2.core.AuthorizationGrantType>> authorizationGrantTypesConsumer) AConsumer
of theauthorization grant type(s)
allowing the ability to add, replace, or remove.build()
Builds a newRegisteredClient
.clientAuthenticationMethod
(org.springframework.security.oauth2.core.ClientAuthenticationMethod clientAuthenticationMethod) Adds anauthentication method
the client may use when authenticating with the authorization server.clientAuthenticationMethods
(Consumer<Set<org.springframework.security.oauth2.core.ClientAuthenticationMethod>> clientAuthenticationMethodsConsumer) AConsumer
of theauthentication method(s)
allowing the ability to add, replace, or remove.Sets the client identifier.clientIdIssuedAt
(Instant clientIdIssuedAt) Sets the time at which the client identifier was issued.clientName
(String clientName) Sets the client name.clientSecret
(String clientSecret) Sets the client secret.clientSecretExpiresAt
(Instant clientSecretExpiresAt) Sets the time at which the client secret expires ornull
if it does not expire.clientSettings
(ClientSettings clientSettings) Sets theclient configuration settings
.Sets the identifier for the registration.postLogoutRedirectUri
(String postLogoutRedirectUri) Adds a post logout redirect URI the client may use for logout.postLogoutRedirectUris
(Consumer<Set<String>> postLogoutRedirectUrisConsumer) AConsumer
of the post logout redirect URI(s) allowing the ability to add, replace, or remove.redirectUri
(String redirectUri) Adds a redirect URI the client may use in a redirect-based flow.redirectUris
(Consumer<Set<String>> redirectUrisConsumer) AConsumer
of the redirect URI(s) allowing the ability to add, replace, or remove.Adds a scope the client may use.AConsumer
of the scope(s) allowing the ability to add, replace, or remove.tokenSettings
(TokenSettings tokenSettings) Sets thetoken configuration settings
.
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
id
Sets the identifier for the registration.- Parameters:
id
- the identifier for the registration- Returns:
- the
RegisteredClient.Builder
-
clientId
Sets the client identifier.- Parameters:
clientId
- the client identifier- Returns:
- the
RegisteredClient.Builder
-
clientIdIssuedAt
Sets the time at which the client identifier was issued.- Parameters:
clientIdIssuedAt
- the time at which the client identifier was issued- Returns:
- the
RegisteredClient.Builder
-
clientSecret
Sets the client secret.- Parameters:
clientSecret
- the client secret- Returns:
- the
RegisteredClient.Builder
-
clientSecretExpiresAt
Sets the time at which the client secret expires ornull
if it does not expire.- Parameters:
clientSecretExpiresAt
- the time at which the client secret expires ornull
if it does not expire- Returns:
- the
RegisteredClient.Builder
-
clientName
Sets the client name.- Parameters:
clientName
- the client name- Returns:
- the
RegisteredClient.Builder
-
clientAuthenticationMethod
public RegisteredClient.Builder clientAuthenticationMethod(org.springframework.security.oauth2.core.ClientAuthenticationMethod clientAuthenticationMethod) Adds anauthentication method
the client may use when authenticating with the authorization server.- Parameters:
clientAuthenticationMethod
- the authentication method- Returns:
- the
RegisteredClient.Builder
-
clientAuthenticationMethods
public RegisteredClient.Builder clientAuthenticationMethods(Consumer<Set<org.springframework.security.oauth2.core.ClientAuthenticationMethod>> clientAuthenticationMethodsConsumer) AConsumer
of theauthentication method(s)
allowing the ability to add, replace, or remove.- Parameters:
clientAuthenticationMethodsConsumer
- aConsumer
of the authentication method(s)- Returns:
- the
RegisteredClient.Builder
-
authorizationGrantType
public RegisteredClient.Builder authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType) Adds anauthorization grant type
the client may use.- Parameters:
authorizationGrantType
- the authorization grant type- Returns:
- the
RegisteredClient.Builder
-
authorizationGrantTypes
public RegisteredClient.Builder authorizationGrantTypes(Consumer<Set<org.springframework.security.oauth2.core.AuthorizationGrantType>> authorizationGrantTypesConsumer) AConsumer
of theauthorization grant type(s)
allowing the ability to add, replace, or remove.- Parameters:
authorizationGrantTypesConsumer
- aConsumer
of the authorization grant type(s)- Returns:
- the
RegisteredClient.Builder
-
redirectUri
Adds a redirect URI the client may use in a redirect-based flow.- Parameters:
redirectUri
- the redirect URI- Returns:
- the
RegisteredClient.Builder
-
redirectUris
AConsumer
of the redirect URI(s) allowing the ability to add, replace, or remove.- Parameters:
redirectUrisConsumer
- aConsumer
of the redirect URI(s)- Returns:
- the
RegisteredClient.Builder
-
postLogoutRedirectUri
Adds a post logout redirect URI the client may use for logout. Thepost_logout_redirect_uri
parameter is used by the client when requesting that the End-User's User Agent be redirected to after a logout has been performed.- Parameters:
postLogoutRedirectUri
- the post logout redirect URI- Returns:
- the
RegisteredClient.Builder
- Since:
- 1.1
-
postLogoutRedirectUris
public RegisteredClient.Builder postLogoutRedirectUris(Consumer<Set<String>> postLogoutRedirectUrisConsumer) AConsumer
of the post logout redirect URI(s) allowing the ability to add, replace, or remove.- Parameters:
postLogoutRedirectUrisConsumer
- aConsumer
of the post logout redirect URI(s)- Returns:
- the
RegisteredClient.Builder
- Since:
- 1.1
-
scope
Adds a scope the client may use.- Parameters:
scope
- the scope- Returns:
- the
RegisteredClient.Builder
-
scopes
AConsumer
of the scope(s) allowing the ability to add, replace, or remove.- Parameters:
scopesConsumer
- aConsumer
of the scope(s)- Returns:
- the
RegisteredClient.Builder
-
clientSettings
Sets theclient configuration settings
.- Parameters:
clientSettings
- the client configuration settings- Returns:
- the
RegisteredClient.Builder
-
tokenSettings
Sets thetoken configuration settings
.- Parameters:
tokenSettings
- the token configuration settings- Returns:
- the
RegisteredClient.Builder
-
build
Builds a newRegisteredClient
.- Returns:
- a
RegisteredClient
-