Class ProgrammaticSingleSignOnCache
- java.lang.Object
-
- org.wildfly.security.http.util.sso.ProgrammaticSingleSignOnCache
-
- All Implemented Interfaces:
IdentityCache
public class ProgrammaticSingleSignOnCache extends Object implements IdentityCache
An implementation ofIdentityCacheto provide SSO for programmatic authentication.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classProgrammaticSingleSignOnCache.SSOHttpServerRequestAn implementation ofHttpServerRequestwhich can be used with the {link SingleSignOnSessionFactory}.
-
Field Summary
Fields Modifier and Type Field Description private SingleSignOnConfigurationconfigurationprivate HttpExchangeSpihttpExchangeSpiprivate HttpServerRequesthttpServerRequestprivate StringmechanismNameprivate SingleSignOnSessionFactorysingleSignOnSessionFactoryprivate StringssoSessionId
-
Constructor Summary
Constructors Constructor Description ProgrammaticSingleSignOnCache(HttpExchangeSpi httpExchangeSpi, String mechanismName, SingleSignOnSessionFactory singleSignOnSessionFactory, SingleSignOnConfiguration configuration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearCookie()CachedIdentityget()Returns an identity previously cached.private HttpServerCookiegetCookie()private HttpServerRequestgetOrCreateHttpServerRequest()private SingleSignOnSessiongetSingleSignOnSession(boolean create)private StringgetSSOSessionId()static IdentityCachenewInstance(HttpExchangeSpi httpExchangeSpi, String mechanismName, SingleSignOnSessionFactory singleSignOnSessionFactory, SingleSignOnConfiguration configuration)voidput(SecurityIdentity identity)Puts aSecurityIdentityinto the cache.CachedIdentityremove()Removes an identity from the cache.private voidsetCookie()
-
-
-
Field Detail
-
httpExchangeSpi
private final HttpExchangeSpi httpExchangeSpi
-
mechanismName
private final String mechanismName
-
singleSignOnSessionFactory
private final SingleSignOnSessionFactory singleSignOnSessionFactory
-
configuration
private final SingleSignOnConfiguration configuration
-
httpServerRequest
private volatile HttpServerRequest httpServerRequest
-
ssoSessionId
private volatile String ssoSessionId
-
-
Constructor Detail
-
ProgrammaticSingleSignOnCache
ProgrammaticSingleSignOnCache(HttpExchangeSpi httpExchangeSpi, String mechanismName, SingleSignOnSessionFactory singleSignOnSessionFactory, SingleSignOnConfiguration configuration)
-
-
Method Detail
-
get
public CachedIdentity get()
Description copied from interface:IdentityCacheReturns an identity previously cached.- Specified by:
getin interfaceIdentityCache- Returns:
- the cached identity or
nullif there is no identity in the cache
-
put
public void put(SecurityIdentity identity)
Description copied from interface:IdentityCachePuts aSecurityIdentityinto the cache.- Specified by:
putin interfaceIdentityCache- Parameters:
identity- the identity to cache (notnull)
-
remove
public CachedIdentity remove()
Description copied from interface:IdentityCacheRemoves an identity from the cache.- Specified by:
removein interfaceIdentityCache- Returns:
- the cached identity or
nullif there is no identity in the cache
-
getOrCreateHttpServerRequest
private HttpServerRequest getOrCreateHttpServerRequest()
-
getSSOSessionId
private String getSSOSessionId()
-
getSingleSignOnSession
private SingleSignOnSession getSingleSignOnSession(boolean create)
-
getCookie
private HttpServerCookie getCookie()
-
setCookie
private void setCookie()
-
clearCookie
private void clearCookie()
-
newInstance
public static IdentityCache newInstance(HttpExchangeSpi httpExchangeSpi, String mechanismName, SingleSignOnSessionFactory singleSignOnSessionFactory, SingleSignOnConfiguration configuration)
-
-