Apache CXF API

org.apache.cxf.rs.security.oauth.data
Class Token

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth.data.Token
Direct Known Subclasses:
AccessToken, RequestToken

public abstract class Token
extends Object

Base Token representation


Constructor Summary
protected Token(Client client, String tokenKey, String tokenSecret, long lifetime, long issuedAt)
           
 
Method Summary
 Client getClient()
          Returns the Client associated with this token
 long getIssuedAt()
          Returns the time (in seconds) when this token was issued at
 long getLifetime()
          Returns the number of seconds this token can be valid after it was issued
 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
 String getTokenKey()
          Returns the token key
 String getTokenSecret()
          Returns the token secret
 boolean isPreAuthorized()
           
 void setPreAuthorized(boolean preAuthorized)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Token

protected Token(Client client,
                String tokenKey,
                String tokenSecret,
                long lifetime,
                long issuedAt)
Method Detail

getClient

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

Returns:
the client

getTokenKey

public String getTokenKey()
Returns the token key

Returns:
the key

getTokenSecret

public String getTokenSecret()
Returns the token secret

Returns:
the secret

getIssuedAt

public long getIssuedAt()
Returns the time (in seconds) when this token was issued at

Returns:
the seconds

getLifetime

public long getLifetime()
Returns the number of seconds this token can be valid after it was issued

Returns:
the seconds

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

setPreAuthorized

public void setPreAuthorized(boolean preAuthorized)

isPreAuthorized

public boolean isPreAuthorized()

Apache CXF API

Apache CXF