Class ServerAccessToken
- java.lang.Object
-
- org.apache.cxf.rs.security.oauth2.common.AccessToken
-
- org.apache.cxf.rs.security.oauth2.common.ServerAccessToken
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BearerAccessToken,HawkAccessToken,RefreshToken
@MappedSuperclass public abstract class ServerAccessToken extends AccessToken
Server Access Token representation- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServerAccessToken()protectedServerAccessToken(Client client, String tokenType, String tokenKey, long expiresIn)protectedServerAccessToken(Client client, String tokenType, String tokenKey, long expiresIn, long issuedAt)protectedServerAccessToken(ServerAccessToken token, String key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getAudiences()ClientgetClient()Returns the Client associated with this tokenStringgetClientCodeVerifier()Map<String,String>getExtraProperties()StringgetGrantCode()Get the grant codeStringgetGrantType()Returns the grant type which was used to obtain the access tokenStringgetNonce()StringgetResponseType()Get the response typeList<OAuthPermission>getScopes()Returns a list of opaque permissions/scopesUserSubjectgetSubject()Returns a subject capturing the login name the end user used to login to the resource server when authorizing a given client requestvoidsetAudiences(List<String> audiences)voidsetClient(Client c)voidsetClientCodeVerifier(String clientCodeVerifier)voidsetExtraProperties(Map<String,String> extraProperties)voidsetGrantCode(String grantCode)Set the grant code which was used to request the tokenvoidsetGrantType(String grantType)Sets the grant type which was used to obtain the access tokenvoidsetNonce(String nonce)voidsetResponseType(String responseType)Set the response typevoidsetScopes(List<OAuthPermission> scopes)Sets a list of opaque permissions/scopesvoidsetSubject(UserSubject subject)Sets a subject capturing the login name the end user used to login to the resource server when authorizing a given client requestprotected static ServerAccessTokenvalidateTokenType(ServerAccessToken token, String expectedType)-
Methods inherited from class org.apache.cxf.rs.security.oauth2.common.AccessToken
getEncodedToken, getExpiresIn, getIssuedAt, getIssuer, getNotBefore, getParameters, getRefreshToken, getTokenKey, getTokenType, setEncodedToken, setExpiresIn, setIssuedAt, setIssuer, setNotBefore, setParameters, setRefreshToken, setTokenKey, setTokenType
-
-
-
-
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
-
validateTokenType
protected static ServerAccessToken validateTokenType(ServerAccessToken token, String expectedType)
-
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
-
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
-
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-
-
getGrantType
public String getGrantType()
Returns the grant type which was used to obtain the access token- Returns:
- the grant type
-
setGrantType
public void setGrantType(String grantType)
Sets the grant type which was used to obtain the access token- Parameters:
grantType- the grant type
-
getResponseType
public String getResponseType()
Get the response type- Returns:
- the response type, null if no redirection flow was used
-
setResponseType
public void setResponseType(String responseType)
Set the response type- Parameters:
responseType- the response type
-
getClientCodeVerifier
public String getClientCodeVerifier()
-
setClientCodeVerifier
public void setClientCodeVerifier(String clientCodeVerifier)
-
getNonce
public String getNonce()
-
setNonce
public void setNonce(String nonce)
-
getGrantCode
public String getGrantCode()
Get the grant code- Returns:
- the grant code, null if no authorization code grant was used
-
setGrantCode
public void setGrantCode(String grantCode)
Set the grant code which was used to request the token- Parameters:
grantCode- the grant code
-
-