Class AbstractOAuth2ClientRegistration.AbstractBuilder<T extends AbstractOAuth2ClientRegistration,B extends AbstractOAuth2ClientRegistration.AbstractBuilder<T,B>>
java.lang.Object
org.springframework.security.oauth2.server.authorization.AbstractOAuth2ClientRegistration.AbstractBuilder<T,B>
- Type Parameters:
T- the type of objectB- the type of the builder
- Direct Known Subclasses:
OAuth2ClientRegistration.Builder,OidcClientRegistration.Builder
- Enclosing class:
- AbstractOAuth2ClientRegistration
protected abstract static class AbstractOAuth2ClientRegistration.AbstractBuilder<T extends AbstractOAuth2ClientRegistration,B extends AbstractOAuth2ClientRegistration.AbstractBuilder<T,B>>
extends Object
A builder for subclasses of
AbstractOAuth2ClientRegistration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tbuild()Validate the claims and build theAbstractOAuth2ClientRegistration.Sets the claim.Provides access to everyclaim(String, Object)declared so far allowing the ability to add, replace, or remove.Sets the Client Identifier, REQUIRED.clientIdIssuedAt(Instant clientIdIssuedAt) Sets the time at which the Client Identifier was issued, OPTIONAL.clientName(String clientName) Sets the name of the Client to be presented to the End-User, OPTIONAL.clientSecret(String clientSecret) Sets the Client Secret, OPTIONAL.clientSecretExpiresAt(Instant clientSecretExpiresAt) Sets the time at which theclient_secretwill expire ornullif it will not expire, REQUIRED ifclient_secretwas issued.protected final BgetThis()Add the OAuth 2.0grant_typethat the Client will restrict itself to using, OPTIONAL.grantTypes(Consumer<List<String>> grantTypesConsumer) AConsumerof the OAuth 2.0grant_typevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.Sets theURLfor the Client's JSON Web Key Set, OPTIONAL.redirectUri(String redirectUri) Add the redirectionURIused by the Client, REQUIRED for redirect-based flows.redirectUris(Consumer<List<String>> redirectUrisConsumer) AConsumerof the redirectionURIvalues used by the Client, allowing the ability to add, replace, or remove, REQUIRED for redirect-based flows.responseType(String responseType) Add the OAuth 2.0response_typethat the Client will restrict itself to using, OPTIONAL.responseTypes(Consumer<List<String>> responseTypesConsumer) AConsumerof the OAuth 2.0response_typevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.Add the OAuth 2.0scopethat the Client will restrict itself to using, OPTIONAL.AConsumerof the OAuth 2.0scopevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.tokenEndpointAuthenticationMethod(String tokenEndpointAuthenticationMethod) Sets the authentication method used by the Client for the Token Endpoint, OPTIONAL.protected voidvalidate()
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
getClaims
-
getThis
-
clientId
Sets the Client Identifier, REQUIRED.- Parameters:
clientId- the Client Identifier- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
clientIdIssuedAt
Sets the time at which the Client Identifier was issued, OPTIONAL.- Parameters:
clientIdIssuedAt- the time at which the Client Identifier was issued- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
clientSecret
Sets the Client Secret, OPTIONAL.- Parameters:
clientSecret- the Client Secret- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
clientSecretExpiresAt
Sets the time at which theclient_secretwill expire ornullif it will not expire, REQUIRED ifclient_secretwas issued.- Parameters:
clientSecretExpiresAt- the time at which theclient_secretwill expire ornullif it will not expire- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
clientName
Sets the name of the Client to be presented to the End-User, OPTIONAL.- Parameters:
clientName- the name of the Client to be presented to the End-User- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
redirectUri
Add the redirectionURIused by the Client, REQUIRED for redirect-based flows.- Parameters:
redirectUri- the redirectionURIused by the Client- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
redirectUris
AConsumerof the redirectionURIvalues used by the Client, allowing the ability to add, replace, or remove, REQUIRED for redirect-based flows.- Parameters:
redirectUrisConsumer- aConsumerof the redirectionURIvalues used by the Client- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
tokenEndpointAuthenticationMethod
Sets the authentication method used by the Client for the Token Endpoint, OPTIONAL.- Parameters:
tokenEndpointAuthenticationMethod- the authentication method used by the Client for the Token Endpoint- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
grantType
Add the OAuth 2.0grant_typethat the Client will restrict itself to using, OPTIONAL.- Parameters:
grantType- the OAuth 2.0grant_typethat the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
grantTypes
AConsumerof the OAuth 2.0grant_typevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.- Parameters:
grantTypesConsumer- aConsumerof the OAuth 2.0grant_typevalues that the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
responseType
Add the OAuth 2.0response_typethat the Client will restrict itself to using, OPTIONAL.- Parameters:
responseType- the OAuth 2.0response_typethat the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
responseTypes
AConsumerof the OAuth 2.0response_typevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.- Parameters:
responseTypesConsumer- aConsumerof the OAuth 2.0response_typevalues that the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
scope
Add the OAuth 2.0scopethat the Client will restrict itself to using, OPTIONAL.- Parameters:
scope- the OAuth 2.0scopethat the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
scopes
AConsumerof the OAuth 2.0scopevalues that the Client will restrict itself to using, allowing the ability to add, replace, or remove, OPTIONAL.- Parameters:
scopesConsumer- aConsumerof the OAuth 2.0scopevalues that the Client will restrict itself to using- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
jwkSetUrl
Sets theURLfor the Client's JSON Web Key Set, OPTIONAL.- Parameters:
jwkSetUrl- theURLfor the Client's JSON Web Key Set- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
claim
Sets the claim.- Parameters:
name- the claim namevalue- the claim value- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configuration
-
claims
Provides access to everyclaim(String, Object)declared so far allowing the ability to add, replace, or remove.- Parameters:
claimsConsumer- aConsumerof the claims- Returns:
- the
AbstractOAuth2ClientRegistration.AbstractBuilderfor further configurations
-
build
Validate the claims and build theAbstractOAuth2ClientRegistration.- Returns:
- the
AbstractOAuth2ClientRegistration
-
validate
protected void validate()
-