Interface ClientDetails
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
OAuth2ClientDetailsJson
,OAuth2WritableClientDetailsJson
Client details for OAuth 2
- Author:
- Ryan Heaton
-
Method Summary
Modifier and TypeMethodDescriptionThe access token validity period for this client.Additional information for this client, not needed by the vanilla OAuth protocol but might be useful, for example, for storing descriptive information.Collection<org.springframework.security.core.GrantedAuthority>
Returns the authorities that are granted to the OAuth client.The grant types for which this client is authorized.The client id.The client secret.The refresh token validity period for this client.The pre-defined redirect URI for this client to use during the "authorization_code" access grant.The resources that this client can access.getScope()
The scope of this client.boolean
isAutoApprove
(String scope) Test whether client needs user approval for a particular scope.boolean
isScoped()
Whether this client is limited to a specific scope.boolean
Whether a secret is required to authenticate this client.
-
Method Details
-
getClientId
The client id.- Returns:
- The client id.
-
getResourceIds
The resources that this client can access. Can be ignored by callers if empty.- Returns:
- The resources of this client.
-
isSecretRequired
boolean isSecretRequired()Whether a secret is required to authenticate this client.- Returns:
- Whether a secret is required to authenticate this client.
-
getClientSecret
The client secret. Ignored if thesecret isn't required
.- Returns:
- The client secret.
-
isScoped
boolean isScoped()Whether this client is limited to a specific scope. If false, the scope of the authentication request will be ignored.- Returns:
- Whether this client is limited to a specific scope.
-
getScope
The scope of this client. Empty if the client isn't scoped.- Returns:
- The scope of this client.
-
getAuthorizedGrantTypes
The grant types for which this client is authorized.- Returns:
- The grant types for which this client is authorized.
-
getRegisteredRedirectUri
The pre-defined redirect URI for this client to use during the "authorization_code" access grant. See OAuth spec, section 4.1.1.- Returns:
- The pre-defined redirect URI for this client.
-
getAuthorities
Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()Returns the authorities that are granted to the OAuth client. Cannot returnnull
. Note that these are NOT the authorities that are granted to the user with an authorized access token. Instead, these authorities are inherent to the client itself.- Returns:
- the authorities (never
null
)
-
getAccessTokenValiditySeconds
The access token validity period for this client. Null if not set explicitly (implementations might use that fact to provide a default value for instance).- Returns:
- the access token validity period
-
getRefreshTokenValiditySeconds
The refresh token validity period for this client. Null for default value set by token service, and zero or negative for non-expiring tokens.- Returns:
- the refresh token validity period
-
isAutoApprove
Test whether client needs user approval for a particular scope.- Parameters:
scope
- the scope to consider- Returns:
- true if this client does not need user approval
-
getAdditionalInformation
Additional information for this client, not needed by the vanilla OAuth protocol but might be useful, for example, for storing descriptive information.- Returns:
- a map of additional information
-