Package org.keycloak.adapters
Class RefreshableKeycloakSecurityContext
- java.lang.Object
-
- org.keycloak.KeycloakSecurityContext
-
- org.keycloak.adapters.RefreshableKeycloakSecurityContext
-
- All Implemented Interfaces:
Serializable
public class RefreshableKeycloakSecurityContext extends org.keycloak.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
-
Constructor Summary
Constructors Constructor Description RefreshableKeycloakSecurityContext()RefreshableKeycloakSecurityContext(KeycloakDeployment deployment, AdapterTokenStore tokenStore, String tokenString, org.keycloak.representations.AccessToken token, String idTokenString, org.keycloak.representations.IDToken idToken, String refreshToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeycloakDeploymentgetDeployment()org.keycloak.representations.IDTokengetIdToken()StringgetIdTokenString()StringgetRefreshToken()org.keycloak.representations.AccessTokengetToken()StringgetTokenString()booleanisActive()booleanisTokenTimeToLiveSufficient(org.keycloak.representations.AccessToken token)voidlogout(KeycloakDeployment deployment)booleanrefreshExpiredToken(boolean checkActive)voidsetAuthorizationContext(org.keycloak.AuthorizationContext authorizationContext)voidsetCurrentRequestInfo(KeycloakDeployment deployment, AdapterTokenStore tokenStore)
-
-
-
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, org.keycloak.representations.AccessToken token, String idTokenString, org.keycloak.representations.IDToken idToken, String refreshToken)
-
-
Method Detail
-
getToken
public org.keycloak.representations.AccessToken getToken()
- Overrides:
getTokenin classorg.keycloak.KeycloakSecurityContext
-
getTokenString
public String getTokenString()
- Overrides:
getTokenStringin classorg.keycloak.KeycloakSecurityContext
-
getIdToken
public org.keycloak.representations.IDToken getIdToken()
- Overrides:
getIdTokenin classorg.keycloak.KeycloakSecurityContext
-
getIdTokenString
public String getIdTokenString()
- Overrides:
getIdTokenStringin classorg.keycloak.KeycloakSecurityContext
-
getRefreshToken
public String getRefreshToken()
-
logout
public void logout(KeycloakDeployment deployment)
-
isActive
public boolean isActive()
-
isTokenTimeToLiveSufficient
public boolean isTokenTimeToLiveSufficient(org.keycloak.representations.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(org.keycloak.AuthorizationContext authorizationContext)
-
-