Package org.gluu.oxauth.model.common
Class AbstractAuthorizationGrant
- java.lang.Object
- 
- org.gluu.oxauth.model.common.AbstractAuthorizationGrant
 
- 
- All Implemented Interfaces:
- IAuthorizationGrant
 - Direct Known Subclasses:
- AuthorizationGrant
 
 public abstract class AbstractAuthorizationGrant extends java.lang.Object implements IAuthorizationGrant - Version:
- November 28, 2018
- Author:
- Yuriy Zabrovarnyy, Javier Rojas Blum, Yuriy Movchan
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.concurrent.ConcurrentMap<java.lang.String,AccessToken>accessTokensprotected AppConfigurationappConfigurationprotected java.util.concurrent.ConcurrentMap<java.lang.String,RefreshToken>refreshTokensprotected ScopeCheckerscopeChecker
 - 
Constructor SummaryConstructors Modifier Constructor Description AbstractAuthorizationGrant()protectedAbstractAuthorizationGrant(User user, AuthorizationGrantType authorizationGrantType, Client client, java.util.Date authenticationTime)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcheckScopesPolicy(java.lang.String requestedScopes)Checks the scopes policy configured according to the type of the authorization grant to limit the issued token scopes.AccessTokencreateAccessToken(java.lang.String certAsPem, ExecutionContext executionContext)RefreshTokencreateRefreshToken()AbstractTokengetAccessToken(java.lang.String tokenCode)Gets the access token instance from the id token list or the access token list given its code.java.util.List<AccessToken>getAccessTokens()Returns a list with all the issued access tokens.java.util.Set<java.lang.String>getAccessTokensCodes()Returns a list with all the issued access tokens codes.java.lang.StringgetAcrValues()java.util.DategetAuthenticationTime()AuthorizationCodegetAuthorizationCode()Returns theAuthorizationCode.AuthorizationGrantTypegetAuthorizationGrantType()Returns theAuthorizationGrantType.java.lang.StringgetClaims()ClientgetClient()Returns theClient.java.lang.StringgetClientDn()java.lang.StringgetClientId()java.lang.StringgetCodeChallenge()java.lang.StringgetCodeChallengeMethod()java.lang.StringgetGrantId()IdTokengetIdToken()JwtAuthorizationRequestgetJwtAuthorizationRequest()AccessTokengetLongLivedAccessToken()java.lang.StringgetNonce()RefreshTokengetRefreshToken(java.lang.String refreshTokenCode)Gets the refresh token instance from the refresh token list given its code.java.util.List<RefreshToken>getRefreshTokens()Returns a list with all the issued refresh tokens.java.util.Set<java.lang.String>getRefreshTokensCodes()Returns a list with all the issued refresh tokens codes.java.util.Set<java.lang.String>getScopes()Returns a list of the scopes granted to the client.java.lang.StringgetSessionDn()java.lang.StringgetTokenBindingHash()TokenLdapgetTokenLdap()UsergetUser()Returns the resource owner's.java.lang.StringgetUserDn()java.lang.StringgetUserId()java.lang.StringgetX5cs256()protected voidinit(User user, AuthorizationGrantType authorizationGrantType, Client client, java.util.Date authenticationTime)voidsetAccessTokens(java.util.List<AccessToken> accessTokens)voidsetAcrValues(java.lang.String acrValues)voidsetAuthenticationTime(java.util.Date authenticationTime)voidsetAuthorizationCode(AuthorizationCode authorizationCode)Sets theAuthorizationCode.voidsetClaims(java.lang.String claims)voidsetCodeChallenge(java.lang.String codeChallenge)voidsetCodeChallengeMethod(java.lang.String codeChallengeMethod)voidsetGrantId(java.lang.String p_grantId)voidsetIdToken(IdToken idToken)voidsetJwtAuthorizationRequest(JwtAuthorizationRequest p_jwtAuthorizationRequest)voidsetLongLivedAccessToken(AccessToken longLivedAccessToken)voidsetNonce(java.lang.String nonce)voidsetRefreshTokens(java.util.List<RefreshToken> refreshTokens)voidsetScopes(java.util.Collection<java.lang.String> scopes)voidsetSessionDn(java.lang.String sessionDn)voidsetTokenBindingHash(java.lang.String tokenBindingHash)voidsetTokenLdap(TokenLdap p_tokenLdap)voidsetX5cs256(java.lang.String x5cs256)java.lang.StringtoString()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.gluu.oxauth.model.common.IAuthorizationGrantcheckExpiredTokens, createIdToken, getGrantType, getSub, revokeAllTokens, save
 
- 
 
- 
- 
- 
Field Detail- 
appConfiguration@Inject protected AppConfiguration appConfiguration 
 - 
scopeChecker@Inject protected ScopeChecker scopeChecker 
 - 
accessTokensprotected final java.util.concurrent.ConcurrentMap<java.lang.String,AccessToken> accessTokens 
 - 
refreshTokensprotected final java.util.concurrent.ConcurrentMap<java.lang.String,RefreshToken> refreshTokens 
 
- 
 - 
Constructor Detail- 
AbstractAuthorizationGrantpublic AbstractAuthorizationGrant() 
 - 
AbstractAuthorizationGrantprotected AbstractAuthorizationGrant(User user, AuthorizationGrantType authorizationGrantType, Client client, java.util.Date authenticationTime) 
 
- 
 - 
Method Detail- 
initprotected void init(User user, AuthorizationGrantType authorizationGrantType, Client client, java.util.Date authenticationTime) 
 - 
getGrantIdpublic java.lang.String getGrantId() - Specified by:
- getGrantIdin interface- IAuthorizationGrant
 
 - 
setGrantIdpublic void setGrantId(java.lang.String p_grantId) - Specified by:
- setGrantIdin interface- IAuthorizationGrant
 
 - 
getAuthorizationCodepublic AuthorizationCode getAuthorizationCode() Returns theAuthorizationCode.- Specified by:
- getAuthorizationCodein interface- IAuthorizationGrant
- Returns:
- The authorization code.
 
 - 
setAuthorizationCodepublic void setAuthorizationCode(AuthorizationCode authorizationCode) Sets theAuthorizationCode.- Specified by:
- setAuthorizationCodein interface- IAuthorizationGrant
- Parameters:
- authorizationCode- The authorization code.
 
 - 
getTokenBindingHashpublic java.lang.String getTokenBindingHash() 
 - 
setTokenBindingHashpublic void setTokenBindingHash(java.lang.String tokenBindingHash) 
 - 
getX5cs256public java.lang.String getX5cs256() 
 - 
setX5cs256public void setX5cs256(java.lang.String x5cs256) 
 - 
getNoncepublic java.lang.String getNonce() - Specified by:
- getNoncein interface- IAuthorizationGrant
 
 - 
setNoncepublic void setNonce(java.lang.String nonce) - Specified by:
- setNoncein interface- IAuthorizationGrant
 
 - 
getCodeChallengepublic java.lang.String getCodeChallenge() 
 - 
setCodeChallengepublic void setCodeChallenge(java.lang.String codeChallenge) 
 - 
getCodeChallengeMethodpublic java.lang.String getCodeChallengeMethod() 
 - 
setCodeChallengeMethodpublic void setCodeChallengeMethod(java.lang.String codeChallengeMethod) 
 - 
getClaimspublic java.lang.String getClaims() 
 - 
setClaimspublic void setClaims(java.lang.String claims) 
 - 
getRefreshTokensCodespublic java.util.Set<java.lang.String> getRefreshTokensCodes() Returns a list with all the issued refresh tokens codes.- Specified by:
- getRefreshTokensCodesin interface- IAuthorizationGrant
- Returns:
- List with all the issued refresh tokens codes.
 
 - 
getAccessTokensCodespublic java.util.Set<java.lang.String> getAccessTokensCodes() Returns a list with all the issued access tokens codes.- Specified by:
- getAccessTokensCodesin interface- IAuthorizationGrant
- Returns:
- List with all the issued access tokens codes.
 
 - 
getAccessTokenspublic java.util.List<AccessToken> getAccessTokens() Returns a list with all the issued access tokens.- Specified by:
- getAccessTokensin interface- IAuthorizationGrant
- Returns:
- List with all the issued access tokens.
 
 - 
setScopespublic void setScopes(java.util.Collection<java.lang.String> scopes) - Specified by:
- setScopesin interface- IAuthorizationGrant
 
 - 
getLongLivedAccessTokenpublic AccessToken getLongLivedAccessToken() - Specified by:
- getLongLivedAccessTokenin interface- IAuthorizationGrant
 
 - 
setLongLivedAccessTokenpublic void setLongLivedAccessToken(AccessToken longLivedAccessToken) - Specified by:
- setLongLivedAccessTokenin interface- IAuthorizationGrant
 
 - 
getIdTokenpublic IdToken getIdToken() - Specified by:
- getIdTokenin interface- IAuthorizationGrant
 
 - 
setIdTokenpublic void setIdToken(IdToken idToken) - Specified by:
- setIdTokenin interface- IAuthorizationGrant
 
 - 
getTokenLdappublic TokenLdap getTokenLdap() - Specified by:
- getTokenLdapin interface- IAuthorizationGrant
 
 - 
setTokenLdappublic void setTokenLdap(TokenLdap p_tokenLdap) - Specified by:
- setTokenLdapin interface- IAuthorizationGrant
 
 - 
getUserpublic User getUser() Returns the resource owner's.- Specified by:
- getUserin interface- IAuthorizationGrant
- Returns:
- The resource owner's.
 
 - 
getAcrValuespublic java.lang.String getAcrValues() - Specified by:
- getAcrValuesin interface- IAuthorizationGrant
 
 - 
setAcrValuespublic void setAcrValues(java.lang.String acrValues) - Specified by:
- setAcrValuesin interface- IAuthorizationGrant
 
 - 
getSessionDnpublic java.lang.String getSessionDn() - Specified by:
- getSessionDnin interface- IAuthorizationGrant
 
 - 
setSessionDnpublic void setSessionDn(java.lang.String sessionDn) - Specified by:
- setSessionDnin interface- IAuthorizationGrant
 
 - 
checkScopesPolicypublic java.lang.String checkScopesPolicy(java.lang.String requestedScopes) Checks the scopes policy configured according to the type of the authorization grant to limit the issued token scopes.- Specified by:
- checkScopesPolicyin interface- IAuthorizationGrant
- Parameters:
- requestedScopes- A space-delimited list of values in which the order of values does not matter.
- Returns:
- A space-delimited list of scopes
 
 - 
createAccessTokenpublic AccessToken createAccessToken(java.lang.String certAsPem, ExecutionContext executionContext) - Specified by:
- createAccessTokenin interface- IAuthorizationGrant
 
 - 
createRefreshTokenpublic RefreshToken createRefreshToken() - Specified by:
- createRefreshTokenin interface- IAuthorizationGrant
 
 - 
getUserIdpublic java.lang.String getUserId() - Specified by:
- getUserIdin interface- IAuthorizationGrant
 
 - 
getUserDnpublic java.lang.String getUserDn() - Specified by:
- getUserDnin interface- IAuthorizationGrant
 
 - 
getAuthorizationGrantTypepublic AuthorizationGrantType getAuthorizationGrantType() Returns theAuthorizationGrantType.- Specified by:
- getAuthorizationGrantTypein interface- IAuthorizationGrant
- Returns:
- The authorization grant type.
 
 - 
getClientpublic Client getClient() Returns theClient. An application making protected resource requests on behalf of the resource owner and with its authorization.- Specified by:
- getClientin interface- IAuthorizationGrant
- Returns:
- The client.
 
 - 
getClientIdpublic java.lang.String getClientId() - Specified by:
- getClientIdin interface- IAuthorizationGrant
 
 - 
getClientDnpublic java.lang.String getClientDn() - Specified by:
- getClientDnin interface- IAuthorizationGrant
 
 - 
getAuthenticationTimepublic java.util.Date getAuthenticationTime() - Specified by:
- getAuthenticationTimein interface- IAuthorizationGrant
 
 - 
setAuthenticationTimepublic void setAuthenticationTime(java.util.Date authenticationTime) 
 - 
getScopespublic java.util.Set<java.lang.String> getScopes() Returns a list of the scopes granted to the client.- Specified by:
- getScopesin interface- IAuthorizationGrant
- Returns:
- List of the scopes granted to the client.
 
 - 
getJwtAuthorizationRequestpublic JwtAuthorizationRequest getJwtAuthorizationRequest() - Specified by:
- getJwtAuthorizationRequestin interface- IAuthorizationGrant
 
 - 
setJwtAuthorizationRequestpublic void setJwtAuthorizationRequest(JwtAuthorizationRequest p_jwtAuthorizationRequest) - Specified by:
- setJwtAuthorizationRequestin interface- IAuthorizationGrant
 
 - 
setAccessTokenspublic void setAccessTokens(java.util.List<AccessToken> accessTokens) - Specified by:
- setAccessTokensin interface- IAuthorizationGrant
 
 - 
getRefreshTokenspublic java.util.List<RefreshToken> getRefreshTokens() Returns a list with all the issued refresh tokens.- Specified by:
- getRefreshTokensin interface- IAuthorizationGrant
- Returns:
- List with all the issued refresh tokens.
 
 - 
setRefreshTokenspublic void setRefreshTokens(java.util.List<RefreshToken> refreshTokens) - Specified by:
- setRefreshTokensin interface- IAuthorizationGrant
 
 - 
getRefreshTokenpublic RefreshToken getRefreshToken(java.lang.String refreshTokenCode) Gets the refresh token instance from the refresh token list given its code.- Specified by:
- getRefreshTokenin interface- IAuthorizationGrant
- Parameters:
- refreshTokenCode- The code of the refresh token.
- Returns:
- The refresh token instance or nullif not found.
 
 - 
getAccessTokenpublic AbstractToken getAccessToken(java.lang.String tokenCode) Gets the access token instance from the id token list or the access token list given its code.- Specified by:
- getAccessTokenin interface- IAuthorizationGrant
- Parameters:
- tokenCode- The code of the access token.
- Returns:
- The access token instance or nullif not found.
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-