Package io.jans.as.server.model.common
Class UnmodifiableAuthorizationGrant
- java.lang.Object
-
- io.jans.as.server.model.common.UnmodifiableAuthorizationGrant
-
- All Implemented Interfaces:
IAuthorizationGrant
public class UnmodifiableAuthorizationGrant extends java.lang.Object implements IAuthorizationGrant
Gives ability to use authorization grant in read-only mode.- Version:
- September 30, 2021
- Author:
- Yuriy Zabrovarnyy, Javier Rojas Blum
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NOT_ALLOWED_FOR_UNMODIFIABLE_AUTHORIZATION_GRANT
-
Constructor Summary
Constructors Constructor Description UnmodifiableAuthorizationGrant(IAuthorizationGrant grant)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkExpiredTokens()
java.lang.String
checkScopesPolicy(java.lang.String scope)
AccessToken
createAccessToken(ExecutionContext executionContext)
IdToken
createIdToken(java.lang.String nonce, AuthorizationCode authorizationCode, AccessToken accessToken, RefreshToken refreshToken, java.lang.String state, ExecutionContext executionContext)
RefreshToken
createRefreshToken(ExecutionContext executionContext)
RefreshToken
createRefreshToken(ExecutionContext executionContext, int lifetime)
AbstractToken
getAccessToken(java.lang.String tokenCode)
java.util.List<AccessToken>
getAccessTokens()
java.util.Set<java.lang.String>
getAccessTokensCodes()
java.lang.String
getAcrValues()
java.util.Date
getAuthenticationTime()
AuthorizationCode
getAuthorizationCode()
AuthorizationGrantType
getAuthorizationGrantType()
io.jans.as.common.model.registration.Client
getClient()
java.lang.String
getClientDn()
java.lang.String
getClientId()
java.lang.String
getGrantId()
io.jans.as.model.common.GrantType
getGrantType()
IdToken
getIdToken()
JwtAuthorizationRequest
getJwtAuthorizationRequest()
AccessToken
getLongLivedAccessToken()
java.lang.String
getNonce()
RefreshToken
getRefreshToken(java.lang.String refreshTokenCode)
java.util.List<RefreshToken>
getRefreshTokens()
java.util.Set<java.lang.String>
getRefreshTokensCodes()
java.util.Set<java.lang.String>
getScopes()
java.lang.String
getSessionDn()
java.lang.String
getSub()
TokenEntity
getTokenEntity()
io.jans.as.common.model.common.User
getUser()
java.lang.String
getUserDn()
java.lang.String
getUserId()
void
revokeAllTokens()
void
save()
Saves changes asynchronouslyvoid
setAccessTokens(java.util.List<AccessToken> accessTokens)
void
setAcrValues(java.lang.String authMode)
void
setAuthorizationCode(AuthorizationCode authorizationCode)
void
setGrantId(java.lang.String grantId)
void
setIdToken(IdToken idToken)
void
setJwtAuthorizationRequest(JwtAuthorizationRequest jwtAuthorizationRequest)
void
setLongLivedAccessToken(AccessToken longLivedAccessToken)
void
setNonce(java.lang.String nonce)
void
setRefreshTokens(java.util.List<RefreshToken> refreshTokens)
void
setScopes(java.util.Collection<java.lang.String> scopes)
void
setSessionDn(java.lang.String sessionDn)
void
setTokenEntity(TokenEntity token)
-
-
-
Field Detail
-
NOT_ALLOWED_FOR_UNMODIFIABLE_AUTHORIZATION_GRANT
public static final java.lang.String NOT_ALLOWED_FOR_UNMODIFIABLE_AUTHORIZATION_GRANT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnmodifiableAuthorizationGrant
public UnmodifiableAuthorizationGrant(IAuthorizationGrant grant)
-
-
Method Detail
-
getGrantType
public io.jans.as.model.common.GrantType getGrantType()
- Specified by:
getGrantType
in interfaceIAuthorizationGrant
-
getGrantId
public java.lang.String getGrantId()
- Specified by:
getGrantId
in interfaceIAuthorizationGrant
-
setGrantId
public void setGrantId(java.lang.String grantId)
- Specified by:
setGrantId
in interfaceIAuthorizationGrant
-
getAuthorizationCode
public AuthorizationCode getAuthorizationCode()
- Specified by:
getAuthorizationCode
in interfaceIAuthorizationGrant
-
setAuthorizationCode
public void setAuthorizationCode(AuthorizationCode authorizationCode)
- Specified by:
setAuthorizationCode
in interfaceIAuthorizationGrant
-
getNonce
public java.lang.String getNonce()
- Specified by:
getNonce
in interfaceIAuthorizationGrant
-
setNonce
public void setNonce(java.lang.String nonce)
- Specified by:
setNonce
in interfaceIAuthorizationGrant
-
getSub
public java.lang.String getSub()
- Specified by:
getSub
in interfaceIAuthorizationGrant
-
createAccessToken
public AccessToken createAccessToken(ExecutionContext executionContext)
- Specified by:
createAccessToken
in interfaceIAuthorizationGrant
-
createRefreshToken
public RefreshToken createRefreshToken(ExecutionContext executionContext)
- Specified by:
createRefreshToken
in interfaceIAuthorizationGrant
-
createRefreshToken
public RefreshToken createRefreshToken(ExecutionContext executionContext, int lifetime)
- Specified by:
createRefreshToken
in interfaceIAuthorizationGrant
-
createIdToken
public IdToken createIdToken(java.lang.String nonce, AuthorizationCode authorizationCode, AccessToken accessToken, RefreshToken refreshToken, java.lang.String state, ExecutionContext executionContext)
- Specified by:
createIdToken
in interfaceIAuthorizationGrant
-
getRefreshToken
public RefreshToken getRefreshToken(java.lang.String refreshTokenCode)
- Specified by:
getRefreshToken
in interfaceIAuthorizationGrant
-
getAccessToken
public AbstractToken getAccessToken(java.lang.String tokenCode)
- Specified by:
getAccessToken
in interfaceIAuthorizationGrant
-
revokeAllTokens
public void revokeAllTokens()
- Specified by:
revokeAllTokens
in interfaceIAuthorizationGrant
-
checkExpiredTokens
public void checkExpiredTokens()
- Specified by:
checkExpiredTokens
in interfaceIAuthorizationGrant
-
checkScopesPolicy
public java.lang.String checkScopesPolicy(java.lang.String scope)
- Specified by:
checkScopesPolicy
in interfaceIAuthorizationGrant
-
getUser
public io.jans.as.common.model.common.User getUser()
- Specified by:
getUser
in interfaceIAuthorizationGrant
-
getUserId
public java.lang.String getUserId()
- Specified by:
getUserId
in interfaceIAuthorizationGrant
-
getUserDn
public java.lang.String getUserDn()
- Specified by:
getUserDn
in interfaceIAuthorizationGrant
-
getAuthorizationGrantType
public AuthorizationGrantType getAuthorizationGrantType()
- Specified by:
getAuthorizationGrantType
in interfaceIAuthorizationGrant
-
getClientId
public java.lang.String getClientId()
- Specified by:
getClientId
in interfaceIAuthorizationGrant
-
getClient
public io.jans.as.common.model.registration.Client getClient()
- Specified by:
getClient
in interfaceIAuthorizationGrant
-
getClientDn
public java.lang.String getClientDn()
- Specified by:
getClientDn
in interfaceIAuthorizationGrant
-
getAccessTokens
public java.util.List<AccessToken> getAccessTokens()
- Specified by:
getAccessTokens
in interfaceIAuthorizationGrant
-
getScopes
public java.util.Set<java.lang.String> getScopes()
- Specified by:
getScopes
in interfaceIAuthorizationGrant
-
getRefreshTokensCodes
public java.util.Set<java.lang.String> getRefreshTokensCodes()
- Specified by:
getRefreshTokensCodes
in interfaceIAuthorizationGrant
-
getAccessTokensCodes
public java.util.Set<java.lang.String> getAccessTokensCodes()
- Specified by:
getAccessTokensCodes
in interfaceIAuthorizationGrant
-
getRefreshTokens
public java.util.List<RefreshToken> getRefreshTokens()
- Specified by:
getRefreshTokens
in interfaceIAuthorizationGrant
-
setRefreshTokens
public void setRefreshTokens(java.util.List<RefreshToken> refreshTokens)
- Specified by:
setRefreshTokens
in interfaceIAuthorizationGrant
-
getLongLivedAccessToken
public AccessToken getLongLivedAccessToken()
- Specified by:
getLongLivedAccessToken
in interfaceIAuthorizationGrant
-
getIdToken
public IdToken getIdToken()
- Specified by:
getIdToken
in interfaceIAuthorizationGrant
-
getJwtAuthorizationRequest
public JwtAuthorizationRequest getJwtAuthorizationRequest()
- Specified by:
getJwtAuthorizationRequest
in interfaceIAuthorizationGrant
-
setJwtAuthorizationRequest
public void setJwtAuthorizationRequest(JwtAuthorizationRequest jwtAuthorizationRequest)
- Specified by:
setJwtAuthorizationRequest
in interfaceIAuthorizationGrant
-
getAuthenticationTime
public java.util.Date getAuthenticationTime()
- Specified by:
getAuthenticationTime
in interfaceIAuthorizationGrant
-
getTokenEntity
public TokenEntity getTokenEntity()
- Specified by:
getTokenEntity
in interfaceIAuthorizationGrant
-
setTokenEntity
public void setTokenEntity(TokenEntity token)
- Specified by:
setTokenEntity
in interfaceIAuthorizationGrant
-
setLongLivedAccessToken
public void setLongLivedAccessToken(AccessToken longLivedAccessToken)
- Specified by:
setLongLivedAccessToken
in interfaceIAuthorizationGrant
-
setIdToken
public void setIdToken(IdToken idToken)
- Specified by:
setIdToken
in interfaceIAuthorizationGrant
-
setScopes
public void setScopes(java.util.Collection<java.lang.String> scopes)
- Specified by:
setScopes
in interfaceIAuthorizationGrant
-
setAccessTokens
public void setAccessTokens(java.util.List<AccessToken> accessTokens)
- Specified by:
setAccessTokens
in interfaceIAuthorizationGrant
-
getAcrValues
public java.lang.String getAcrValues()
- Specified by:
getAcrValues
in interfaceIAuthorizationGrant
-
setAcrValues
public void setAcrValues(java.lang.String authMode)
- Specified by:
setAcrValues
in interfaceIAuthorizationGrant
-
getSessionDn
public java.lang.String getSessionDn()
- Specified by:
getSessionDn
in interfaceIAuthorizationGrant
-
setSessionDn
public void setSessionDn(java.lang.String sessionDn)
- Specified by:
setSessionDn
in interfaceIAuthorizationGrant
-
save
public void save()
Description copied from interface:IAuthorizationGrant
Saves changes asynchronously- Specified by:
save
in interfaceIAuthorizationGrant
-
-