Class DefaultSingleSignOnSession
- java.lang.Object
-
- org.wildfly.security.http.util.sso.DefaultSingleSignOnSession
-
- All Implemented Interfaces:
AutoCloseable
,IdentityCache
,SingleSignOnSession
public class DefaultSingleSignOnSession extends Object implements SingleSignOnSession
SingleSignOnSession
that delegates its persistence strategy to aSingleSignOnManager
.SingleSignOn
entries are created lazily in response toput(SecurityIdentity)
.
This implementation supports single logout in order to invalidate local sessions for each participant of a single sign-on session, where participants represent the applications with active sessions associated with a given single sign-on session.- Author:
- Paul Ferraro
-
-
Field Summary
Fields Modifier and Type Field Description private SingleSignOnSessionContext
context
private static String
LOGOUT_REQUEST_PARAMETER
private ConcurrentMap<Boolean,SingleSignOn>
map
private HttpServerRequest
request
private static String
SESSION_INVALIDATING_ATTRIBUTE
private static Boolean
SINGLE_SIGN_ON_KEY
private Function<SecurityIdentity,SingleSignOn>
ssoFactory
-
Constructor Summary
Constructors Constructor Description DefaultSingleSignOnSession(SingleSignOnSessionContext context, HttpServerRequest request, String mechanismName, boolean programmatic)
DefaultSingleSignOnSession(SingleSignOnSessionContext context, HttpServerRequest request, SingleSignOn sso)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes any resources associated with this single sign-on session.CachedIdentity
get()
Returns an identity previously cached.private static CachedIdentity
getCachedIdentity(SingleSignOn sso)
String
getId()
The identifier associated with this session.(package private) void
invalidateLocalSession(HttpScope scope)
boolean
logout()
Performs a local logout if the incoming request is a logout message, otherwise do nothing.void
put(SecurityIdentity identity)
Puts aSecurityIdentity
into the cache.CachedIdentity
remove()
Removes an identity from the cache.
-
-
-
Field Detail
-
LOGOUT_REQUEST_PARAMETER
private static final String LOGOUT_REQUEST_PARAMETER
- See Also:
- Constant Field Values
-
SESSION_INVALIDATING_ATTRIBUTE
private static final String SESSION_INVALIDATING_ATTRIBUTE
-
SINGLE_SIGN_ON_KEY
private static final Boolean SINGLE_SIGN_ON_KEY
-
request
private final HttpServerRequest request
-
map
private final ConcurrentMap<Boolean,SingleSignOn> map
-
context
private final SingleSignOnSessionContext context
-
ssoFactory
private final Function<SecurityIdentity,SingleSignOn> ssoFactory
-
-
Constructor Detail
-
DefaultSingleSignOnSession
public DefaultSingleSignOnSession(SingleSignOnSessionContext context, HttpServerRequest request, String mechanismName, boolean programmatic)
-
DefaultSingleSignOnSession
public DefaultSingleSignOnSession(SingleSignOnSessionContext context, HttpServerRequest request, SingleSignOn sso)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:SingleSignOnSession
The identifier associated with this session.- Specified by:
getId
in interfaceSingleSignOnSession
- Returns:
- identifier associated with this session
-
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
-
logout
public boolean logout()
Description copied from interface:SingleSignOnSession
Performs a local logout if the incoming request is a logout message, otherwise do nothing.- Specified by:
logout
in interfaceSingleSignOnSession
- Returns:
true
if local session was invalidated. Otherwise,false
-
close
public void close()
Description copied from interface:SingleSignOnSession
Closes any resources associated with this single sign-on session.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSingleSignOnSession
-
invalidateLocalSession
void invalidateLocalSession(HttpScope scope)
-
getCachedIdentity
private static CachedIdentity getCachedIdentity(SingleSignOn sso)
-
-