Apache CXF API

org.apache.cxf.rs.security.oauth2.common
Class ServerAccessToken

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.common.AccessToken
      extended by org.apache.cxf.rs.security.oauth2.common.ServerAccessToken
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BearerAccessToken, HawkAccessToken, RefreshToken

public abstract class ServerAccessToken
extends AccessToken

Server Access Token representation

See Also:
Serialized Form

Constructor Summary
protected ServerAccessToken()
           
protected ServerAccessToken(Client client, String tokenType, String tokenKey, long expiresIn)
           
protected ServerAccessToken(Client client, String tokenType, String tokenKey, long expiresIn, long issuedAt)
           
protected ServerAccessToken(ServerAccessToken token, String key)
           
 
Method Summary
 String getAudience()
           
 Client getClient()
          Returns the Client associated with this token
 String getGrantType()
          Returns the grant type which was used to obtain the access token
 List<OAuthPermission> getScopes()
          Returns a list of opaque permissions/scopes
 UserSubject getSubject()
          Returns a subject capturing the login name the end user used to login to the resource server when authorizing a given client request
 void setAudience(String audience)
           
 void setClient(Client c)
           
 void setGrantType(String grantType)
          Sets the grant type which was used to obtain the access token
 void setScopes(List<OAuthPermission> scopes)
          Sets a list of opaque permissions/scopes
 void setSubject(UserSubject subject)
          Sets a subject capturing the login name the end user used to login to the resource server when authorizing a given client request
protected static ServerAccessToken validateTokenType(ServerAccessToken token, String expectedType)
           
 
Methods inherited from class org.apache.cxf.rs.security.oauth2.common.AccessToken
getExpiresIn, getIssuedAt, getParameters, getRefreshToken, getTokenKey, getTokenType, setExpiresIn, setIssuedAt, setParameters, setRefreshToken, setTokenKey, setTokenType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerAccessToken

protected ServerAccessToken()

ServerAccessToken

protected ServerAccessToken(Client client,
                            String tokenType,
                            String tokenKey,
                            long expiresIn)

ServerAccessToken

protected ServerAccessToken(Client client,
                            String tokenType,
                            String tokenKey,
                            long expiresIn,
                            long issuedAt)

ServerAccessToken

protected ServerAccessToken(ServerAccessToken token,
                            String key)
Method Detail

getClient

public Client getClient()
Returns the Client associated with this token

Returns:
the client

setClient

public void setClient(Client c)

getScopes

public List<OAuthPermission> getScopes()
Returns a list of opaque permissions/scopes

Returns:
the scopes

setScopes

public void setScopes(List<OAuthPermission> scopes)
Sets a list of opaque permissions/scopes

Parameters:
scopes - the scopes

setSubject

public void setSubject(UserSubject subject)
Sets a subject capturing the login name the end user used to login to the resource server when authorizing a given client request

Parameters:
subject -

getSubject

public UserSubject getSubject()
Returns a subject capturing the login name the end user used to login to the resource server when authorizing a given client request

Returns:
UserSubject

setGrantType

public void setGrantType(String grantType)
Sets the grant type which was used to obtain the access token

Parameters:
grantType - the grant type

getGrantType

public String getGrantType()
Returns the grant type which was used to obtain the access token

Returns:
the grant type

getAudience

public String getAudience()

setAudience

public void setAudience(String audience)

validateTokenType

protected static ServerAccessToken validateTokenType(ServerAccessToken token,
                                                     String expectedType)

Apache CXF API

Apache CXF