Class ClientRegistration
- java.lang.Object
-
- org.springframework.security.oauth2.client.registration.ClientRegistration
-
- All Implemented Interfaces:
java.io.Serializable
public final class ClientRegistration extends java.lang.Object implements java.io.SerializableA representation of a client registration with an OAuth 2.0 or OpenID Connect 1.0 Provider.- Since:
- 5.0
- See Also:
- Section 2 Client Registration, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClientRegistration.BuilderA builder forClientRegistration.classClientRegistration.ProviderDetailsDetails of the Provider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationGrantTypegetAuthorizationGrantType()Returns theauthorization grant typeused for the client.ClientAuthenticationMethodgetClientAuthenticationMethod()Returns theauthentication methodused when authenticating the client with the authorization server.java.lang.StringgetClientId()Returns the client identifier.java.lang.StringgetClientName()Returns the logical name of the client or registration.java.lang.StringgetClientSecret()Returns the client secret.ClientRegistration.ProviderDetailsgetProviderDetails()Returns the details of the provider.java.lang.StringgetRedirectUriTemplate()Returns the uri (or uri template) for the redirection endpoint.java.lang.StringgetRegistrationId()Returns the identifier for the registration.java.util.Set<java.lang.String>getScopes()Returns the scope(s) used for the client.java.lang.StringtoString()static ClientRegistration.BuilderwithClientRegistration(ClientRegistration clientRegistration)Returns a newClientRegistration.Builder, initialized with the providedClientRegistration.static ClientRegistration.BuilderwithRegistrationId(java.lang.String registrationId)Returns a newClientRegistration.Builder, initialized with the provided registration identifier.
-
-
-
Method Detail
-
getRegistrationId
public java.lang.String getRegistrationId()
Returns the identifier for the registration.- Returns:
- the identifier for the registration
-
getClientId
public java.lang.String getClientId()
Returns the client identifier.- Returns:
- the client identifier
-
getClientSecret
public java.lang.String getClientSecret()
Returns the client secret.- Returns:
- the client secret
-
getClientAuthenticationMethod
public ClientAuthenticationMethod getClientAuthenticationMethod()
Returns theauthentication methodused when authenticating the client with the authorization server.- Returns:
- the
ClientAuthenticationMethod
-
getAuthorizationGrantType
public AuthorizationGrantType getAuthorizationGrantType()
Returns theauthorization grant typeused for the client.- Returns:
- the
AuthorizationGrantType
-
getRedirectUriTemplate
public java.lang.String getRedirectUriTemplate()
Returns the uri (or uri template) for the redirection endpoint.- Returns:
- the uri for the redirection endpoint
-
getScopes
public java.util.Set<java.lang.String> getScopes()
Returns the scope(s) used for the client.- Returns:
- the
Setof scope(s)
-
getProviderDetails
public ClientRegistration.ProviderDetails getProviderDetails()
Returns the details of the provider.- Returns:
- the
ClientRegistration.ProviderDetails
-
getClientName
public java.lang.String getClientName()
Returns the logical name of the client or registration.- Returns:
- the client or registration name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
withRegistrationId
public static ClientRegistration.Builder withRegistrationId(java.lang.String registrationId)
Returns a newClientRegistration.Builder, initialized with the provided registration identifier.- Parameters:
registrationId- the identifier for the registration- Returns:
- the
ClientRegistration.Builder
-
withClientRegistration
public static ClientRegistration.Builder withClientRegistration(ClientRegistration clientRegistration)
Returns a newClientRegistration.Builder, initialized with the providedClientRegistration.- Parameters:
clientRegistration- theClientRegistrationto copy from- Returns:
- the
ClientRegistration.Builder
-
-