Package org.wildfly.security.http.oidc
Class RefreshableOidcSecurityContext
- java.lang.Object
-
- org.wildfly.security.http.oidc.OidcSecurityContext
-
- org.wildfly.security.http.oidc.RefreshableOidcSecurityContext
-
- All Implemented Interfaces:
Serializable
public class RefreshableOidcSecurityContext extends OidcSecurityContext
- Author:
- Bill Burke, Farah Juma
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OidcClientConfiguration
clientConfiguration
protected String
refreshToken
protected OidcTokenStore
tokenStore
-
Fields inherited from class org.wildfly.security.http.oidc.OidcSecurityContext
idToken, idTokenString, token, tokenString
-
-
Constructor Summary
Constructors Constructor Description RefreshableOidcSecurityContext()
RefreshableOidcSecurityContext(OidcClientConfiguration clientConfiguration, OidcTokenStore tokenStore, String tokenString, AccessToken token, String idTokenString, IDToken idToken, String refreshToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDToken
getIDToken()
String
getIDTokenString()
OidcClientConfiguration
getOidcClientConfiguration()
String
getRefreshToken()
AccessToken
getToken()
String
getTokenString()
boolean
isActive()
boolean
isTokenTimeToLiveSufficient(AccessToken token)
void
logout(OidcClientConfiguration clientConfiguration)
boolean
refreshToken(boolean checkActive)
Refresh a token if needed.void
setCurrentRequestInfo(OidcClientConfiguration clientConfiguration, OidcTokenStore tokenStore)
-
Methods inherited from class org.wildfly.security.http.oidc.OidcSecurityContext
getRealm
-
-
-
-
Field Detail
-
clientConfiguration
protected transient OidcClientConfiguration clientConfiguration
-
tokenStore
protected transient OidcTokenStore tokenStore
-
refreshToken
protected String refreshToken
-
-
Constructor Detail
-
RefreshableOidcSecurityContext
public RefreshableOidcSecurityContext()
-
RefreshableOidcSecurityContext
public RefreshableOidcSecurityContext(OidcClientConfiguration clientConfiguration, OidcTokenStore tokenStore, String tokenString, AccessToken token, String idTokenString, IDToken idToken, String refreshToken)
-
-
Method Detail
-
getToken
public AccessToken getToken()
- Overrides:
getToken
in classOidcSecurityContext
-
getTokenString
public String getTokenString()
- Overrides:
getTokenString
in classOidcSecurityContext
-
getIDToken
public IDToken getIDToken()
- Overrides:
getIDToken
in classOidcSecurityContext
-
getIDTokenString
public String getIDTokenString()
- Overrides:
getIDTokenString
in classOidcSecurityContext
-
getRefreshToken
public String getRefreshToken()
-
logout
public void logout(OidcClientConfiguration clientConfiguration)
-
isActive
public boolean isActive()
-
isTokenTimeToLiveSufficient
public boolean isTokenTimeToLiveSufficient(AccessToken token)
-
getOidcClientConfiguration
public OidcClientConfiguration getOidcClientConfiguration()
-
setCurrentRequestInfo
public void setCurrentRequestInfo(OidcClientConfiguration clientConfiguration, OidcTokenStore tokenStore)
-
refreshToken
public boolean refreshToken(boolean checkActive)
Refresh a token if needed.- 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
-
-