Package org.forgerock.oauth2.core
Class AuthorizationCode
- java.lang.Object
-
- org.forgerock.json.JsonValue
-
- org.forgerock.oauth2.core.AuthorizationCode
-
-
Constructor Summary
Constructors Constructor Description AuthorizationCode(String code, String resourceOwnerId, String clientId, String redirectUri, Set<String> scope, String claims, long expiryTime, String nonce, String realm, String authModules, String acr, String ssoTokenId, String codeChallenge, String codeChallengeMethod, String authGrantId, String auditId)Constructs a new AuthorizationCode.AuthorizationCode(org.forgerock.json.JsonValue token)Constructs a new AuthorizationCode backed with the data in the specified JsonValue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAuditTrackingId()Get the audit tracking ID for this token.AuditConstants.TrackingIdKeygetAuditTrackingIdKey()Get the audit tracking ID key for this token.StringgetAuthenticationContextClassReference()Get the Authentication Context Class Reference (acr).StringgetAuthGrantId()Gets the authorization grant idStringgetAuthModules()Get the auth modules string.StringgetClaims()Returns the requested claims.StringgetClientId()Gets the client's id.StringgetCodeChallenge()Get the code challengeStringgetCodeChallengeMethod()Get the code challenge methodlonggetExpiryTime()Gets the expiry time.StringgetNonce()Gets the nonce.StringgetRealm()Gets the realm.StringgetRedirectUri()Gets the redirect uri.StringgetResourceOwnerId()Gets the resource owner's id.Set<String>getScope()Gets the scope.StringgetSessionId()Gets the session id of the authenticating session.StringgetTokenId()Gets the token's identifier.Map<String,Object>getTokenInfo()Gets the token's information.StringgetTokenName()Gets the token's name.StringgetTokenType()Gets the token type.booleanisExpired()Determines if the Authorization Code is expired.booleanisIssued()Determines whether the authorization code has been issued.voidsetIssued()Sets the authorization code as issued.org.forgerock.json.JsonValuetoJsonValue()Gets theJsonValuerepresentation of the token.Map<String,Object>toMap()Converts the token into aMapof its key data.-
Methods inherited from class org.forgerock.json.JsonValue
add, add, add, add, addPermissive, array, as, asBigDecimal, asBoolean, asCollection, asCollection, asDouble, asEnum, asInteger, asList, asList, asLong, asMap, asMap, asMapOfList, asNumber, asSet, asSet, asString, asURI, clear, clone, contains, copy, defaultTo, diff, expect, field, fieldIfNotNull, get, get, get, getObject, getPointer, isBoolean, isCollection, isDefined, isEqualTo, isList, isMap, isNotNull, isNull, isNumber, isSet, isString, iterator, json, keys, object, object, patch, put, put, put, putPermissive, remove, remove, remove, required, set, setObject, size, toIndex, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
AuthorizationCode
public AuthorizationCode(org.forgerock.json.JsonValue token) throws InvalidGrantExceptionConstructs a new AuthorizationCode backed with the data in the specified JsonValue.- Parameters:
token- The JsonValue of the token.- Throws:
InvalidGrantException- If the given token is not an Authorization Code token.
-
AuthorizationCode
public AuthorizationCode(String code, String resourceOwnerId, String clientId, String redirectUri, Set<String> scope, String claims, long expiryTime, String nonce, String realm, String authModules, String acr, String ssoTokenId, String codeChallenge, String codeChallengeMethod, String authGrantId, String auditId)
Constructs a new AuthorizationCode.- Parameters:
code- The authorization code.resourceOwnerId- The resource owner's id.clientId- The client's id.redirectUri- The redirect uri.scope- The scopes.expiryTime- The expiry time.nonce- The nonce.
-
-
Method Detail
-
isExpired
public final boolean isExpired()
Determines if the Authorization Code is expired.- Returns:
trueif current time is greater than the expiry time.
-
getExpiryTime
public long getExpiryTime()
Gets the expiry time.- Returns:
- The Expiry time.
-
getTokenId
public String getTokenId()
Gets the token's identifier.- Specified by:
getTokenIdin interfaceToken- Returns:
- The token's id.
-
getTokenType
public String getTokenType()
Gets the token type.- Returns:
- The token type.
-
getTokenName
public String getTokenName()
Gets the token's name.- Specified by:
getTokenNamein interfaceToken- Returns:
- The token's name.
-
isIssued
public boolean isIssued()
Determines whether the authorization code has been issued.- Returns:
trueif the authorization code has been issued.
-
getRedirectUri
public String getRedirectUri()
Gets the redirect uri.- Returns:
- The redirect uri.
-
getClientId
public String getClientId()
Gets the client's id.- Returns:
- The client's id.
-
getResourceOwnerId
public String getResourceOwnerId()
Gets the resource owner's id.- Returns:
- The resource owner's id.
-
getAuthModules
public String getAuthModules()
Get the auth modules string.- Returns:
- The pipe-separated list of auth modules.
-
getAuthenticationContextClassReference
public String getAuthenticationContextClassReference()
Get the Authentication Context Class Reference (acr).- Returns:
- The acr string matched, if any.
-
getNonce
public String getNonce()
Gets the nonce.- Returns:
- The nonce.
-
getSessionId
public String getSessionId()
Gets the session id of the authenticating session.- Returns:
- The session id.
-
setIssued
public void setIssued()
Sets the authorization code as issued.
-
getTokenInfo
public Map<String,Object> getTokenInfo()
Gets the token's information.- Specified by:
getTokenInfoin interfaceToken- Returns:
- A
Mapof the token's information.
-
getCodeChallenge
public String getCodeChallenge()
Get the code challenge- Returns:
- code challenge
-
getCodeChallengeMethod
public String getCodeChallengeMethod()
Get the code challenge method- Returns:
- code challenge method
-
getAuthGrantId
public String getAuthGrantId()
Gets the authorization grant id- Returns:
- The authorization grant id
-
toJsonValue
public org.forgerock.json.JsonValue toJsonValue()
Gets theJsonValuerepresentation of the token.- Specified by:
toJsonValuein interfaceToken- Returns:
- The
JsonValuerepresentation of the token.
-
getAuditTrackingId
public String getAuditTrackingId()
Description copied from interface:TokenGet the audit tracking ID for this token.- Specified by:
getAuditTrackingIdin interfaceToken- Returns:
- The tracking ID.
-
getAuditTrackingIdKey
public AuditConstants.TrackingIdKey getAuditTrackingIdKey()
Description copied from interface:TokenGet the audit tracking ID key for this token.- Specified by:
getAuditTrackingIdKeyin interfaceToken- Returns:
- The tracking ID key.
-
getClaims
public String getClaims()
Returns the requested claims.- Returns:
- The requested claims.
-
getRealm
public String getRealm()
Gets the realm.- Returns:
- The realm.
-
-