Package io.jans.as.server.model.common
Class AbstractAuthorizationGrant
java.lang.Object
io.jans.as.server.model.common.AbstractAuthorizationGrant
- All Implemented Interfaces:
IAuthorizationGrant
- Direct Known Subclasses:
AuthorizationGrant
- Version:
- September 30, 2021
- Author:
- Yuriy Zabrovarnyy, Javier Rojas Blum, Yuriy Movchan
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<String,
AccessToken> protected io.jans.as.model.configuration.AppConfiguration
protected final ConcurrentMap<String,
LogoutStatusJwt> protected final ConcurrentMap<String,
RefreshToken> protected ScopeChecker
protected final ConcurrentMap<String,
TxToken> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
AbstractAuthorizationGrant
(io.jans.as.common.model.common.User user, AuthorizationGrantType authorizationGrantType, io.jans.as.common.model.registration.Client client, Date authenticationTime) -
Method Summary
Modifier and TypeMethodDescriptioncheckScopesPolicy
(String requestedScopes) Checks the scopes policy configured according to the type of the authorization grant to limit the issued token scopes.createAccessToken
(ExecutionContext executionContext) createRefreshToken
(ExecutionContext context) createRefreshToken
(ExecutionContext context, int lifetime) getAccessToken
(String tokenCode) Gets the access token instance from the id token list or the access token list given its code.int
getAccessTokenLifetimeInSeconds
(ExecutionContext executionContext) Returns a list with all the issued access tokens.Returns a list with all the issued access tokens codes.Returns theAuthorizationCode
.Returns theAuthorizationGrantType
.io.jans.as.model.authzdetails.AuthzDetails
io.jans.as.common.model.registration.Client
Returns theClient
.getLogoutStatusJwt
(String logoutStatusJwtCode) Gets the logout out jwt instance from the logout status jwt list given its code.Returns a list with all the issued logout status jwts.Returns a list with all the issued logout status jwts.getNonce()
getRefreshToken
(String refreshTokenCode) Gets the refresh token instance from the refresh token list given its code.Returns a list with all the issued refresh tokens.Returns a list with all the issued refresh tokens codes.Returns a list of the scopes granted to the client.io.jans.model.token.TokenEntity
getTxToken
(String txTokenCode) io.jans.as.common.model.common.User
getUser()
Returns the resource owner's.protected void
init
(io.jans.as.common.model.common.User user, AuthorizationGrantType authorizationGrantType, io.jans.as.common.model.registration.Client client, Date authenticationTime) boolean
void
setAccessTokens
(List<AccessToken> accessTokens) void
setAcrValues
(String acrValues) void
setAuthenticationTime
(Date authenticationTime) setAuthorizationChallenge
(boolean authorizationChallenge) void
setAuthorizationCode
(AuthorizationCode authorizationCode) Sets theAuthorizationCode
.void
setAuthzDetails
(io.jans.as.model.authzdetails.AuthzDetails authzDetails) void
void
setCodeChallenge
(String codeChallenge) void
setCodeChallengeMethod
(String codeChallengeMethod) void
setDpopJkt
(String dpopJkt) void
setGrantId
(String grantId) void
setIdToken
(IdToken idToken) void
setJwtAuthorizationRequest
(JwtAuthorizationRequest jwtAuthorizationRequest) void
setLogoutStatusJwts
(List<LogoutStatusJwt> tokens) void
setLongLivedAccessToken
(AccessToken longLivedAccessToken) void
void
setReferenceId
(String referenceId) void
setRefreshTokens
(List<RefreshToken> refreshTokens) void
setScopes
(Collection<String> scopes) void
setSessionDn
(String sessionDn) void
setStatusListIndex
(Integer statusListIndex) void
setTokenBindingHash
(String tokenBindingHash) void
setTokenEntity
(io.jans.model.token.TokenEntity tokenEntity) void
setTxTokens
(List<TxToken> txTokens) void
setX5ts256
(String x5ts256) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.jans.as.server.model.common.IAuthorizationGrant
checkExpiredTokens, createIdToken, createLogoutStatusJwt, getGrantType, getSub, revokeAllTokens, save
-
Field Details
-
appConfiguration
@Inject protected io.jans.as.model.configuration.AppConfiguration appConfiguration -
scopeChecker
-
txTokens
-
accessTokens
-
refreshTokens
-
logoutStatusJwts
-
-
Constructor Details
-
AbstractAuthorizationGrant
protected AbstractAuthorizationGrant() -
AbstractAuthorizationGrant
protected AbstractAuthorizationGrant(io.jans.as.common.model.common.User user, AuthorizationGrantType authorizationGrantType, io.jans.as.common.model.registration.Client client, Date authenticationTime)
-
-
Method Details
-
init
protected void init(io.jans.as.common.model.common.User user, AuthorizationGrantType authorizationGrantType, io.jans.as.common.model.registration.Client client, Date authenticationTime) -
getReferenceId
-
setReferenceId
-
isAuthorizationChallenge
public boolean isAuthorizationChallenge() -
setAuthorizationChallenge
-
getStatusListIndex
-
setStatusListIndex
-
getDpopJkt
-
setDpopJkt
-
getGrantId
- Specified by:
getGrantId
in interfaceIAuthorizationGrant
-
setGrantId
- Specified by:
setGrantId
in interfaceIAuthorizationGrant
-
getAuthorizationCode
Returns theAuthorizationCode
.- Specified by:
getAuthorizationCode
in interfaceIAuthorizationGrant
- Returns:
- The authorization code.
-
setAuthorizationCode
Sets theAuthorizationCode
.- Specified by:
setAuthorizationCode
in interfaceIAuthorizationGrant
- Parameters:
authorizationCode
- The authorization code.
-
getTokenBindingHash
-
setTokenBindingHash
-
getX5ts256
-
setX5ts256
-
getNonce
- Specified by:
getNonce
in interfaceIAuthorizationGrant
-
setNonce
- Specified by:
setNonce
in interfaceIAuthorizationGrant
-
getCodeChallenge
-
setCodeChallenge
-
getCodeChallengeMethod
-
setCodeChallengeMethod
-
getClaims
-
setClaims
-
getRefreshTokensCodes
Returns a list with all the issued refresh tokens codes.- Specified by:
getRefreshTokensCodes
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued refresh tokens codes.
-
getLogoutStatusJwtsCodes
Returns a list with all the issued logout status jwts.- Specified by:
getLogoutStatusJwtsCodes
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued logout status jwts.
-
getAccessTokensCodes
Returns a list with all the issued access tokens codes.- Specified by:
getAccessTokensCodes
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued access tokens codes.
-
getAccessTokens
Returns a list with all the issued access tokens.- Specified by:
getAccessTokens
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued access tokens.
-
getTxTokens
-
getTxToken
-
setScopes
- Specified by:
setScopes
in interfaceIAuthorizationGrant
-
getLongLivedAccessToken
- Specified by:
getLongLivedAccessToken
in interfaceIAuthorizationGrant
-
setLongLivedAccessToken
- Specified by:
setLongLivedAccessToken
in interfaceIAuthorizationGrant
-
getIdToken
- Specified by:
getIdToken
in interfaceIAuthorizationGrant
-
setIdToken
- Specified by:
setIdToken
in interfaceIAuthorizationGrant
-
getTokenEntity
public io.jans.model.token.TokenEntity getTokenEntity()- Specified by:
getTokenEntity
in interfaceIAuthorizationGrant
-
setTokenEntity
public void setTokenEntity(io.jans.model.token.TokenEntity tokenEntity) - Specified by:
setTokenEntity
in interfaceIAuthorizationGrant
-
getUser
public io.jans.as.common.model.common.User getUser()Returns the resource owner's.- Specified by:
getUser
in interfaceIAuthorizationGrant
- Returns:
- The resource owner's.
-
getAcrValues
- Specified by:
getAcrValues
in interfaceIAuthorizationGrant
-
setAcrValues
- Specified by:
setAcrValues
in interfaceIAuthorizationGrant
-
getSessionDn
- Specified by:
getSessionDn
in interfaceIAuthorizationGrant
-
setSessionDn
- Specified by:
setSessionDn
in interfaceIAuthorizationGrant
-
checkScopesPolicy
Checks the scopes policy configured according to the type of the authorization grant to limit the issued token scopes.- Specified by:
checkScopesPolicy
in interfaceIAuthorizationGrant
- Parameters:
requestedScopes
- A space-delimited list of values in which the order of values does not matter.- Returns:
- A space-delimited list of scopes
-
getAccessTokenLifetimeInSeconds
-
createAccessToken
- Specified by:
createAccessToken
in interfaceIAuthorizationGrant
-
createRefreshToken
- Specified by:
createRefreshToken
in interfaceIAuthorizationGrant
-
createRefreshToken
- Specified by:
createRefreshToken
in interfaceIAuthorizationGrant
-
getUserId
- Specified by:
getUserId
in interfaceIAuthorizationGrant
-
getUserDn
- Specified by:
getUserDn
in interfaceIAuthorizationGrant
-
getAuthorizationGrantType
Returns theAuthorizationGrantType
.- Specified by:
getAuthorizationGrantType
in interfaceIAuthorizationGrant
- Returns:
- The authorization grant type.
-
getClient
public io.jans.as.common.model.registration.Client getClient()Returns theClient
. An application making protected resource requests on behalf of the resource owner and with its authorization.- Specified by:
getClient
in interfaceIAuthorizationGrant
- Returns:
- The client.
-
getClientId
- Specified by:
getClientId
in interfaceIAuthorizationGrant
-
getClientDn
- Specified by:
getClientDn
in interfaceIAuthorizationGrant
-
getAuthenticationTime
- Specified by:
getAuthenticationTime
in interfaceIAuthorizationGrant
-
setAuthenticationTime
-
getScopes
Returns a list of the scopes granted to the client.- Specified by:
getScopes
in interfaceIAuthorizationGrant
- Returns:
- List of the scopes granted to the client.
-
getAuthzDetailsAsString
-
getAuthzDetails
public io.jans.as.model.authzdetails.AuthzDetails getAuthzDetails() -
setAuthzDetails
public void setAuthzDetails(io.jans.as.model.authzdetails.AuthzDetails authzDetails) -
getJwtAuthorizationRequest
- Specified by:
getJwtAuthorizationRequest
in interfaceIAuthorizationGrant
-
setJwtAuthorizationRequest
- Specified by:
setJwtAuthorizationRequest
in interfaceIAuthorizationGrant
-
setAccessTokens
- Specified by:
setAccessTokens
in interfaceIAuthorizationGrant
-
setTxTokens
- Specified by:
setTxTokens
in interfaceIAuthorizationGrant
-
getLogoutStatusJwts
Returns a list with all the issued logout status jwts.- Specified by:
getLogoutStatusJwts
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued logout status jwts.
-
setLogoutStatusJwts
- Specified by:
setLogoutStatusJwts
in interfaceIAuthorizationGrant
-
getLogoutStatusJwt
Gets the logout out jwt instance from the logout status jwt list given its code.- Specified by:
getLogoutStatusJwt
in interfaceIAuthorizationGrant
- Parameters:
logoutStatusJwtCode
- The code of the logout status jwt.- Returns:
- The logout status jwt instance or
null
if not found.
-
getRefreshTokens
Returns a list with all the issued refresh tokens.- Specified by:
getRefreshTokens
in interfaceIAuthorizationGrant
- Returns:
- List with all the issued refresh tokens.
-
setRefreshTokens
- Specified by:
setRefreshTokens
in interfaceIAuthorizationGrant
-
getRefreshToken
Gets the refresh token instance from the refresh token list given its code.- Specified by:
getRefreshToken
in interfaceIAuthorizationGrant
- Parameters:
refreshTokenCode
- The code of the refresh token.- Returns:
- The refresh token instance or
null
if not found.
-
getAccessToken
Gets the access token instance from the id token list or the access token list given its code.- Specified by:
getAccessToken
in interfaceIAuthorizationGrant
- Parameters:
tokenCode
- The code of the access token.- Returns:
- The access token instance or
null
if not found.
-
toString
-