AccessToken.java revision ccf9d4a5c6453fa9f8b839baeee25147865fbb7d
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
*/
/**
* Models a OAuth2 access token.
*
* @since 12.0.0
*/
/**
* Constructs a new AccessToken backed with the data in the specified JsonValue.
*
* @param token The JsonValue of the token.
* @throws InvalidGrantException If the given token is not an Access Token.
*/
super(token);
}
/**
* Constructs a new AccessToken backed with the data in the specified JsonValue.
*
* @param token The JsonValue of the token.
* @param tokenName The token name.
* @param tokenId The token identifier.
* @throws InvalidGrantException If the given token is not an Access Token.
*/
public AccessToken(JsonValue token, String tokenName, String tokenId) throws InvalidGrantException {
super(token);
}
/**
* Constructs a new AccessToken.
*
* @param id The token id.
* @param authorizationCode The authorization code.
* @param resourceOwnerId The resource owner's id.
* @param clientId The client's id.
* @param redirectUri The redirect uri.
* @param scope The scope.
* @param expiryTime The expiry time.
* @param refreshTokenId The refresh token id.
* @param tokenName The token name.
* @param grantType The grant type.
* @param nonce The nonce.
*/
public AccessToken(String id, String authorizationCode, String resourceOwnerId, String clientId, String redirectUri,
}
}
/**
* Sets the token id.
*
* @param id The token id.
*/
}
/**
* Sets the authorization code.
*
* @param authorizationCode The authorization code.
*/
}
/**
* Sets the resource owner's id.
*
* @param resourceOwnerId The resource owner's id.
*/
}
/**
* Sets the client's id.
*
* @param clientId The client's id.
*/
}
/**
* Sets the redirect uri.
*
* @param redirectUri The redirect uri.
*/
}
/**
* Sets the scope.
*
* @param scope The scope.
*/
}
/**
* Sets the expiry time.
*
* @param expiryTime The expiry time.
*/
protected void setExpiryTime(long expiryTime) {
}
/**
* Sets the refresh token id.
*
* @param refreshTokenId The refresh token id.
*/
}
/**
* Sets the token type.
*
* @param tokenType The token type.
*/
}
/**
* Sets the token name.
*
* @param tokenName The token name.
*/
}
/**
* Sets the grant type.
*
* @param grantType The grant type.
*/
}
/**
* Sets the nonce.
*
* @param nonce The nonce.
*/
}
/**
* Gets the scope.
*
* @return The scope.
*/
return scope;
}
return Collections.emptySet();
}
/**
* Gets the client's id.
*
* @return The client's id.
*/
public String getClientId() {
}
return null;
}
/**
* Gets the nonce.
*
* @return The nonce.
*/
}
return null;
}
/**
* Gets the session id used to create the authorisation code
*
* @return The session id.
*/
public String getSessionId() {
}
/**
* Gets the resource owner's id.
*
* @return The resource owner's id.
*/
public String getResourceOwnerId() {
}
return null;
}
/**
* {@inheritDoc}
*/
public String getTokenId() {
}
return null;
}
/**
* {@inheritDoc}
*/
public String getTokenName() {
if (isDefined(TOKEN_NAME)) {
}
return null;
}
/**
* Determines if the Access Token is expired.
*
* @return {@code true} if current time is greater than the expiry time.
*/
public boolean isExpired() {
return currentTimeMillis() > getExpiryTime();
}
/**
* {@inheritDoc}
*/
}
/**
* Gets the requested claims associated w/ this access token.
*
* @return Requested claims (JSON as a String).
*/
}
return null;
}
/**
* Gets the expiry time.
*
* @return The Expiry time.
*/
public long getExpiryTime() {
if (isDefined(EXPIRE_TIME)) {
}
return 0;
}
/**
* Gets the token type.
*
* @return The token type.
*/
public String getTokenType() {
if (isDefined(TOKEN_TYPE)) {
}
return null;
}
/**
* Gets the grant type.
*
* @return The grant type.
*/
public String getGrantType() {
}
return null;
}
/**
* Get a string property from the store.
* @param key The property key.
* @return The value.
*/
}
return null;
}
/**
* Gets the display String for the given String.
*
* @param s The String.
* @return The display String.
*/
return s;
}
/**
* {@inheritDoc}
*/
return tokenMap;
}
/**
* {@inheritDoc}
*/
return tokenInfo;
}
/**
* <p>Adds additional data to the Access Token.</p>
*
* <p>If the value is {@code null} then this method will ensure that the key is not present in the map.</p>
*
* @param key The key.
* @param value The value.
*/
} else {
}
}
}
}
}