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 ofIdentityCache
to provide SSO for programmatic authentication.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ProgrammaticSingleSignOnCache.SSOHttpServerRequest
An implementation ofHttpServerRequest
which can be used with the {link SingleSignOnSessionFactory}.
-
Field Summary
Fields Modifier and Type Field Description private SingleSignOnConfiguration
configuration
private HttpExchangeSpi
httpExchangeSpi
private HttpServerRequest
httpServerRequest
private String
mechanismName
private SingleSignOnSessionFactory
singleSignOnSessionFactory
private String
ssoSessionId
-
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 void
clearCookie()
CachedIdentity
get()
Returns an identity previously cached.private HttpServerCookie
getCookie()
private HttpServerRequest
getOrCreateHttpServerRequest()
private SingleSignOnSession
getSingleSignOnSession(boolean create)
private String
getSSOSessionId()
static IdentityCache
newInstance(HttpExchangeSpi httpExchangeSpi, String mechanismName, SingleSignOnSessionFactory singleSignOnSessionFactory, SingleSignOnConfiguration configuration)
void
put(SecurityIdentity identity)
Puts aSecurityIdentity
into the cache.CachedIdentity
remove()
Removes an identity from the cache.private void
setCookie()
-
-
-
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:IdentityCache
Returns an identity previously cached.- Specified by:
get
in interfaceIdentityCache
- Returns:
- the cached identity or
null
if there is no identity in the cache
-
put
public void put(SecurityIdentity identity)
Description copied from interface:IdentityCache
Puts aSecurityIdentity
into the cache.- Specified by:
put
in interfaceIdentityCache
- Parameters:
identity
- the identity to cache (notnull
)
-
remove
public CachedIdentity remove()
Description copied from interface:IdentityCache
Removes an identity from the cache.- Specified by:
remove
in interfaceIdentityCache
- Returns:
- the cached identity or
null
if 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)
-
-