org.springframework.security.oauth2.client.resource
Class BaseOAuth2ProtectedResourceDetails

java.lang.Object
  extended by org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails
All Implemented Interfaces:
OAuth2ProtectedResourceDetails
Direct Known Subclasses:
AbstractRedirectResourceDetails, ClientCredentialsResourceDetails, ResourceOwnerPasswordResourceDetails

public class BaseOAuth2ProtectedResourceDetails
extends Object
implements OAuth2ProtectedResourceDetails

Author:
Ryan Heaton, Dave Syer

Constructor Summary
BaseOAuth2ProtectedResourceDetails()
           
 
Method Summary
 boolean equals(Object o)
           
 String getAccessTokenUri()
          The URL to use to obtain an OAuth2 access token.
 AuthenticationScheme getAuthenticationScheme()
          Get the bearer token method for this resource.
 AuthenticationScheme getClientAuthenticationScheme()
          The scheme to use to authenticate the client.
 String getClientId()
          The client identifier to use for this protected resource.
 String getClientSecret()
          The client secret.
 String getGrantType()
          The grant type for obtaining an acces token for this resource.
 String getId()
          Get a unique identifier for these protected resource details.
 List<String> getScope()
          The scope of this resource.
 String getTokenName()
          The name of the bearer token.
 int hashCode()
           
 boolean isAuthenticationRequired()
          Whether a secret is required to obtain an access token to this resource.
 boolean isClientOnly()
          A flag to indicate that this resource is only to be used with client credentials, thus allowing access tokens to be cached independent of a user's session.
 boolean isScoped()
          Whether this resource is limited to a specific scope.
 void setAccessTokenUri(String accessTokenUri)
           
 void setAuthenticationScheme(AuthenticationScheme authorizationScheme)
           
 void setClientAuthenticationScheme(AuthenticationScheme clientAuthenticationScheme)
           
 void setClientId(String clientId)
           
 void setClientSecret(String clientSecret)
           
 void setGrantType(String grantType)
           
 void setId(String id)
           
 void setScope(List<String> scope)
           
 void setTokenName(String tokenName)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseOAuth2ProtectedResourceDetails

public BaseOAuth2ProtectedResourceDetails()
Method Detail

getId

public String getId()
Description copied from interface: OAuth2ProtectedResourceDetails
Get a unique identifier for these protected resource details.

Specified by:
getId in interface OAuth2ProtectedResourceDetails
Returns:
A unique identifier for these protected resource details.

setId

public void setId(String id)

getClientId

public String getClientId()
Description copied from interface: OAuth2ProtectedResourceDetails
The client identifier to use for this protected resource.

Specified by:
getClientId in interface OAuth2ProtectedResourceDetails
Returns:
The client identifier to use for this protected resource.

setClientId

public void setClientId(String clientId)

getAccessTokenUri

public String getAccessTokenUri()
Description copied from interface: OAuth2ProtectedResourceDetails
The URL to use to obtain an OAuth2 access token.

Specified by:
getAccessTokenUri in interface OAuth2ProtectedResourceDetails
Returns:
The URL to use to obtain an OAuth2 access token.

setAccessTokenUri

public void setAccessTokenUri(String accessTokenUri)

isScoped

public boolean isScoped()
Description copied from interface: OAuth2ProtectedResourceDetails
Whether this resource is limited to a specific scope. If false, the scope of the authentication request will be ignored.

Specified by:
isScoped in interface OAuth2ProtectedResourceDetails
Returns:
Whether this resource is limited to a specific scope.

getScope

public List<String> getScope()
Description copied from interface: OAuth2ProtectedResourceDetails
The scope of this resource. Ignored if the resource isn't scoped.

Specified by:
getScope in interface OAuth2ProtectedResourceDetails
Returns:
The scope of this resource.

setScope

public void setScope(List<String> scope)

isAuthenticationRequired

public boolean isAuthenticationRequired()
Description copied from interface: OAuth2ProtectedResourceDetails
Whether a secret is required to obtain an access token to this resource.

Specified by:
isAuthenticationRequired in interface OAuth2ProtectedResourceDetails
Returns:
Whether a secret is required to obtain an access token to this resource.

getClientSecret

public String getClientSecret()
Description copied from interface: OAuth2ProtectedResourceDetails
The client secret. Ignored if the secret isn't required.

Specified by:
getClientSecret in interface OAuth2ProtectedResourceDetails
Returns:
The client secret.

setClientSecret

public void setClientSecret(String clientSecret)

getClientAuthenticationScheme

public AuthenticationScheme getClientAuthenticationScheme()
Description copied from interface: OAuth2ProtectedResourceDetails
The scheme to use to authenticate the client. E.g. "header" or "query".

Specified by:
getClientAuthenticationScheme in interface OAuth2ProtectedResourceDetails
Returns:
The scheme used to authenticate the client.

setClientAuthenticationScheme

public void setClientAuthenticationScheme(AuthenticationScheme clientAuthenticationScheme)

isClientOnly

public boolean isClientOnly()
Description copied from interface: OAuth2ProtectedResourceDetails
A flag to indicate that this resource is only to be used with client credentials, thus allowing access tokens to be cached independent of a user's session.

Specified by:
isClientOnly in interface OAuth2ProtectedResourceDetails
Returns:
true if this resource is only used with client credentials grant

getAuthenticationScheme

public AuthenticationScheme getAuthenticationScheme()
Description copied from interface: OAuth2ProtectedResourceDetails
Get the bearer token method for this resource.

Specified by:
getAuthenticationScheme in interface OAuth2ProtectedResourceDetails
Returns:
The bearer token method for this resource.

setAuthenticationScheme

public void setAuthenticationScheme(AuthenticationScheme authorizationScheme)

getTokenName

public String getTokenName()
Description copied from interface: OAuth2ProtectedResourceDetails
The name of the bearer token. The default is "access_token", which is according to the spec, but some providers (e.g. Facebook) don't conform to the spec.)

Specified by:
getTokenName in interface OAuth2ProtectedResourceDetails
Returns:
The name of the bearer token.

setTokenName

public void setTokenName(String tokenName)

getGrantType

public String getGrantType()
Description copied from interface: OAuth2ProtectedResourceDetails
The grant type for obtaining an acces token for this resource.

Specified by:
getGrantType in interface OAuth2ProtectedResourceDetails
Returns:
The grant type for obtaining an acces token for this resource.

setGrantType

public void setGrantType(String grantType)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.