Package org.keycloak.adapters
Class RefreshableKeycloakSecurityContext
- java.lang.Object
-
- org.keycloak.KeycloakSecurityContext
-
- org.keycloak.adapters.RefreshableKeycloakSecurityContext
-
- All Implemented Interfaces:
Serializable
public class RefreshableKeycloakSecurityContext extends KeycloakSecurityContext
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected KeycloakDeploymentdeploymentprotected static org.jboss.logging.Loggerlogprotected StringrefreshTokenprotected AdapterTokenStoretokenStore-
Fields inherited from class org.keycloak.KeycloakSecurityContext
authorizationContext, idToken, idTokenString, token, tokenString
-
-
Constructor Summary
Constructors Constructor Description RefreshableKeycloakSecurityContext()RefreshableKeycloakSecurityContext(KeycloakDeployment deployment, AdapterTokenStore tokenStore, String tokenString, AccessToken token, String idTokenString, IDToken idToken, String refreshToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeycloakDeploymentgetDeployment()IDTokengetIdToken()StringgetIdTokenString()StringgetRefreshToken()AccessTokengetToken()StringgetTokenString()booleanisActive()booleanisTokenTimeToLiveSufficient(AccessToken token)voidlogout(KeycloakDeployment deployment)booleanrefreshExpiredToken(boolean checkActive)voidsetAuthorizationContext(AuthorizationContext authorizationContext)voidsetCurrentRequestInfo(KeycloakDeployment deployment, AdapterTokenStore tokenStore)-
Methods inherited from class org.keycloak.KeycloakSecurityContext
getAuthorizationContext, getRealm
-
-
-
-
Field Detail
-
log
protected static org.jboss.logging.Logger log
-
deployment
protected transient KeycloakDeployment deployment
-
tokenStore
protected transient AdapterTokenStore tokenStore
-
refreshToken
protected String refreshToken
-
-
Constructor Detail
-
RefreshableKeycloakSecurityContext
public RefreshableKeycloakSecurityContext()
-
RefreshableKeycloakSecurityContext
public RefreshableKeycloakSecurityContext(KeycloakDeployment deployment, AdapterTokenStore tokenStore, String tokenString, AccessToken token, String idTokenString, IDToken idToken, String refreshToken)
-
-
Method Detail
-
getToken
public AccessToken getToken()
- Overrides:
getTokenin classKeycloakSecurityContext
-
getTokenString
public String getTokenString()
- Overrides:
getTokenStringin classKeycloakSecurityContext
-
getIdToken
public IDToken getIdToken()
- Overrides:
getIdTokenin classKeycloakSecurityContext
-
getIdTokenString
public String getIdTokenString()
- Overrides:
getIdTokenStringin classKeycloakSecurityContext
-
getRefreshToken
public String getRefreshToken()
-
logout
public void logout(KeycloakDeployment deployment)
-
isActive
public boolean isActive()
-
isTokenTimeToLiveSufficient
public boolean isTokenTimeToLiveSufficient(AccessToken token)
-
getDeployment
public KeycloakDeployment getDeployment()
-
setCurrentRequestInfo
public void setCurrentRequestInfo(KeycloakDeployment deployment, AdapterTokenStore tokenStore)
-
refreshExpiredToken
public boolean refreshExpiredToken(boolean checkActive)
- Parameters:
checkActive- if true, then we won't send refresh request if current accessToken is still active.- Returns:
- true if accessToken is active or was successfully refreshed
-
setAuthorizationContext
public void setAuthorizationContext(AuthorizationContext authorizationContext)
-
-