public class OAuth2AccessToken
extends java.lang.Object
implements java.io.Serializable, com.vordel.circuit.oauth.token.ExpiringToken
{
"access_token" : "ya29.AHES6ZQu8zGIjmFBcO2ns6T-4HWwrHimliyxO0TXdGNdAuddZJ8slg",
"token_type" : "Bearer",
"expires_in" : 3600,
"refresh_token" : "1/ZITkPoWBpishGbrqiXW3dzgcgpKbw5S28LNQ98-3FMc"
}
Modifier and Type | Class and Description |
---|---|
static class |
OAuth2AccessToken.JaxbJacksonObjectMapper |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BEARER_TYPE |
static java.lang.String |
OAUTH2_TYPE |
Constructor and Description |
---|
OAuth2AccessToken() |
OAuth2AccessToken(OAuth2AccessToken other) |
OAuth2AccessToken(java.lang.String value)
Create an access token from the value provided.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static OAuth2AccessToken |
generate(int length) |
static OAuth2AccessToken |
generate(int length,
long expiresInSecs) |
static OAuth2AccessToken |
getAccessToken(com.fasterxml.jackson.databind.JsonNode node) |
static OAuth2AccessToken |
getAccessToken(java.lang.String in) |
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalInformation()
Additional information that token granters would like to add to the token, e.g.
|
java.lang.String |
getApplicationID() |
FormURLEncodedBody |
getAsForm() |
Body |
getAsXML() |
Body |
getAsXML(com.vordel.mime.HeaderSet headers,
com.vordel.mime.ContentType ct) |
java.lang.String |
getAuthenticationSubject() |
java.lang.String |
getClientID() |
java.util.Date |
getExpiration()
The instant the token expires.
|
int |
getExpiresIn() |
java.lang.String |
getIdToken() |
OAuth2RefreshToken |
getOAuth2RefreshToken() |
java.lang.String |
getRefreshToken()
The refresh token associated with the access token, if any.
|
java.util.Set<java.lang.String> |
getScope()
The scope of the token.
|
byte[] |
getTokenAsJSON() |
java.lang.String |
getTokenType()
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
java.lang.String |
getValue()
The token value.
|
boolean |
hasExpired() |
int |
hashCode() |
boolean |
hasRefresh() |
boolean |
hasValue() |
boolean |
isExpired()
Convenience method for checking expiration
|
Body |
returnJSONInBody() |
void |
setAdditionalInformation(java.util.Map<java.lang.String,java.lang.String> additionalInformation)
Additional information that token granters would like to add to the token, e.g.
|
void |
setAdditionalInformation(java.lang.String name,
java.lang.String value) |
void |
setApplicationID(java.lang.String applicationID) |
void |
setAuthenticationSubject(java.lang.String authenticationSubject) |
void |
setClientID(java.lang.String clientID) |
void |
setExpiration(java.util.Date expiration)
The instant the token expires.
|
void |
setExpiresIn(int delta) |
void |
setIdToken(java.lang.String idToken) |
void |
setOAuth2RefreshToken(OAuth2RefreshToken refreshToken)
The refresh token associated with the access token, if any.
|
void |
setRefreshDigestValue(java.lang.String digest) |
void |
setRefreshToken(java.lang.String value) |
void |
setScope(java.util.Set<java.lang.String> scope)
The scope of the token.
|
void |
setTokenType(java.lang.String tokenType)
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
void |
setValue(java.lang.String value) |
java.lang.String |
toString() |
static void |
trace(OAuth2AccessToken token,
int level) |
public static java.lang.String BEARER_TYPE
public static java.lang.String OAUTH2_TYPE
public OAuth2AccessToken(java.lang.String value)
value
- The String value of the tokenpublic OAuth2AccessToken(OAuth2AccessToken other)
public OAuth2AccessToken()
public java.lang.String getValue()
public void setValue(java.lang.String value)
public boolean hasValue()
public int getExpiresIn()
public void setExpiresIn(int delta)
public java.util.Date getExpiration()
public void setExpiration(java.util.Date expiration)
expiration
- The instant the token expires.public boolean isExpired()
public java.lang.String getTokenType()
public void setTokenType(java.lang.String tokenType)
tokenType
- The token type, as introduced in draft 11 of the OAuth 2 spec.public java.lang.String getRefreshToken()
public void setRefreshToken(java.lang.String value)
public OAuth2RefreshToken getOAuth2RefreshToken()
public boolean hasRefresh()
public void setOAuth2RefreshToken(OAuth2RefreshToken refreshToken)
refreshToken
- The refresh token associated with the access token, if any.public java.util.Set<java.lang.String> getScope()
public void setScope(java.util.Set<java.lang.String> scope)
scope
- The scope of the token.public java.lang.String getApplicationID()
public void setApplicationID(java.lang.String applicationID)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.String> getAdditionalInformation()
public void setAdditionalInformation(java.util.Map<java.lang.String,java.lang.String> additionalInformation)
additionalInformation
- the additional information to setpublic void setAdditionalInformation(java.lang.String name, java.lang.String value)
public boolean hasExpired()
hasExpired
in interface com.vordel.circuit.oauth.token.ExpiringToken
public byte[] getTokenAsJSON() throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException
com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
public Body returnJSONInBody() throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException
com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
public Body getAsXML(com.vordel.mime.HeaderSet headers, com.vordel.mime.ContentType ct) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public Body getAsXML() throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public FormURLEncodedBody getAsForm() throws java.io.IOException
java.io.IOException
public static OAuth2AccessToken getAccessToken(com.fasterxml.jackson.databind.JsonNode node) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException
com.fasterxml.jackson.core.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
public static OAuth2AccessToken getAccessToken(java.lang.String in) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException
com.fasterxml.jackson.core.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
public static OAuth2AccessToken generate(int length)
public static OAuth2AccessToken generate(int length, long expiresInSecs)
public static void trace(OAuth2AccessToken token, int level)
public java.lang.String getIdToken()
public void setIdToken(java.lang.String idToken)
public void setRefreshDigestValue(java.lang.String digest)
public java.lang.String getAuthenticationSubject()
public void setAuthenticationSubject(java.lang.String authenticationSubject)
public java.lang.String getClientID()
public void setClientID(java.lang.String clientID)
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel