Interface WebAuthSession
public interface WebAuthSession
A WebAuthSession manages a user's
WebAuthSessionContext
for a given IdP based on incoming
WebAuthResponseContext
updates, Security Zones, and any other contextual information available. The
WebAuthSession posts a WebAuthSessionChangeEvent
to its EventBus
when the
WebAuthSessionContext
changes so that any listener may pull the new value by calling getContext()
.-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.eventbus.EventBus
getName()
logout()
Clears the user from thisWebAuthSession
Clears the user from thisWebAuthSession
void
onLoginResponse
(WebAuthResponseContext webAuthResponseContext) Push a newWebAuthResponseContext
when the user logs in from the IdPvoid
onLogoutResponse
(WebAuthResponseContext webAuthResponseContext) Push a newWebAuthResponseContext
when the user logs out from the IdPvoid
shutdown()
Shut down the session.void
startup()
Start up the session.
-
Method Details
-
startup
void startup()Start up the session. May only be called once.- Throws:
IllegalStateException
- if the session was already started or shut down
-
shutdown
void shutdown()Shut down the session. May only be called once after startup.- Throws:
IllegalStateException
- if the session was already shut down or if it was never started
-
getName
- Returns:
- an
Optional
containing the IdP Adapter name associated with this session or an empty Optional if the IdP Adapter name is null
-
getContext
- Returns:
- the latest
WebAuthSessionContext
-
onLoginResponse
Push a newWebAuthResponseContext
when the user logs in from the IdP- Parameters:
webAuthResponseContext
- theWebAuthResponseContext
- Throws:
IllegalStateException
- if the session is not running
-
onLogoutResponse
Push a newWebAuthResponseContext
when the user logs out from the IdP- Parameters:
webAuthResponseContext
- theWebAuthResponseContext
- Throws:
IllegalStateException
- if the session is not running
-
logout
Clears the user from thisWebAuthSession
- Returns:
- an optional signed attributes document used as a hint to the IdP during logout
-
logout
Clears the user from thisWebAuthSession
- Parameters:
message
- an optional message to include with the logout event- Returns:
- an optional signed attributes document used as a hint to the IdP during logout
-
getEventBus
@Nonnull com.google.common.eventbus.EventBus getEventBus()WebAuthSessionChangeEvent
s will be posted to theEventBus
when theWebAuthSession
has changed. Interested parties may callEventBus.register(Object)
to listen for changes.- Returns:
- the
EventBus
for thisWebAuthSession
-