Package org.wildfly.security.http.oidc
Class OidcCookieTokenStore
- java.lang.Object
-
- org.wildfly.security.http.oidc.OidcCookieTokenStore
-
- All Implemented Interfaces:
OidcTokenStore
public class OidcCookieTokenStore extends Object implements OidcTokenStore
- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description OidcCookieTokenStore(OidcHttpFacade httpFacade)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckCurrentToken()Check if the current token exists.static OidcPrincipal<RefreshableOidcSecurityContext>getPrincipalFromCookie(OidcClientConfiguration deployment, OidcHttpFacade facade, OidcCookieTokenStore tokenStore)booleanisCached(RequestAuthenticator authenticator)Check if we are already logged in (i.e., check if we have a valid and successfully refreshed access token).voidlogout()Handle logout on store side and possibly propagate logout call to the OIDC provider.voidlogout(boolean glo)voidlogoutAll()voidlogoutHttpSessions(List<String> ids)voidrefreshCallback(RefreshableOidcSecurityContext securityContext)Callback invoked after a successful token refresh.static voidremoveCookie(OidcClientConfiguration deployment, OidcHttpFacade facade)booleanrestoreRequest()Restore the request.voidsaveAccountInfo(OidcAccount account)Finish a successful login and store the validated account.voidsaveRequest()Save the request.static voidsetTokenCookie(OidcClientConfiguration deployment, OidcHttpFacade facade, RefreshableOidcSecurityContext session)
-
-
-
Constructor Detail
-
OidcCookieTokenStore
public OidcCookieTokenStore(OidcHttpFacade httpFacade)
-
-
Method Detail
-
checkCurrentToken
public void checkCurrentToken()
Description copied from interface:OidcTokenStoreCheck if the current token exists. Refresh the token if it exists but is expired.- Specified by:
checkCurrentTokenin interfaceOidcTokenStore
-
isCached
public boolean isCached(RequestAuthenticator authenticator)
Description copied from interface:OidcTokenStoreCheck if we are already logged in (i.e., check if we have a valid and successfully refreshed access token). If so, establish the security context.- Specified by:
isCachedin interfaceOidcTokenStore- Parameters:
authenticator- used for actual request authentication- Returns:
trueif we are logged in already;falseotherwise
-
saveAccountInfo
public void saveAccountInfo(OidcAccount account)
Description copied from interface:OidcTokenStoreFinish a successful login and store the validated account.- Specified by:
saveAccountInfoin interfaceOidcTokenStore- Parameters:
account- the validated account
-
logout
public void logout()
Description copied from interface:OidcTokenStoreHandle logout on store side and possibly propagate logout call to the OIDC provider.- Specified by:
logoutin interfaceOidcTokenStore
-
refreshCallback
public void refreshCallback(RefreshableOidcSecurityContext securityContext)
Description copied from interface:OidcTokenStoreCallback invoked after a successful token refresh.- Specified by:
refreshCallbackin interfaceOidcTokenStore- Parameters:
securityContext- context where refresh was performed
-
saveRequest
public void saveRequest()
Description copied from interface:OidcTokenStoreSave the request.- Specified by:
saveRequestin interfaceOidcTokenStore
-
restoreRequest
public boolean restoreRequest()
Description copied from interface:OidcTokenStoreRestore the request.- Specified by:
restoreRequestin interfaceOidcTokenStore- Returns:
trueif the request was successfully restored;falseotherwise
-
logout
public void logout(boolean glo)
- Specified by:
logoutin interfaceOidcTokenStore
-
logoutAll
public void logoutAll()
- Specified by:
logoutAllin interfaceOidcTokenStore
-
logoutHttpSessions
public void logoutHttpSessions(List<String> ids)
- Specified by:
logoutHttpSessionsin interfaceOidcTokenStore
-
removeCookie
public static void removeCookie(OidcClientConfiguration deployment, OidcHttpFacade facade)
-
setTokenCookie
public static void setTokenCookie(OidcClientConfiguration deployment, OidcHttpFacade facade, RefreshableOidcSecurityContext session)
-
getPrincipalFromCookie
public static OidcPrincipal<RefreshableOidcSecurityContext> getPrincipalFromCookie(OidcClientConfiguration deployment, OidcHttpFacade facade, OidcCookieTokenStore tokenStore)
-
-