Interface WebAuthSession
- 
 public interface WebAuthSessionA WebAuthSession manages a user'sWebAuthSessionContextfor a given IdP based on incomingWebAuthResponseContextupdates, Security Zones, and any other contextual information available. The WebAuthSession posts aWebAuthSessionChangeEventto itsEventBuswhen theWebAuthSessionContextchanges so that any listener may pull the new value by callinggetContext().
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description WebAuthSessionContextgetContext()com.google.common.eventbus.EventBusgetEventBus()java.util.Optional<java.lang.String>getName()default java.util.Optional<java.lang.String>logout()Clears the user from thisWebAuthSessionjava.util.Optional<java.lang.String>logout(java.lang.String message)Clears the user from thisWebAuthSessionvoidonLoginResponse(WebAuthResponseContext webAuthResponseContext)Push a newWebAuthResponseContextwhen the user logs in from the IdPvoidonLogoutResponse(WebAuthResponseContext webAuthResponseContext)Push a newWebAuthResponseContextwhen the user logs out from the IdPvoidshutdown()Shut down the session.voidstartup()Start up the session.
 
- 
- 
- 
Method Detail- 
startupvoid startup() Start up the session. May only be called once.- Throws:
- java.lang.IllegalStateException- if the session was already started or shut down
 
 - 
shutdownvoid shutdown() Shut down the session. May only be called once after startup.- Throws:
- java.lang.IllegalStateException- if the session was already shut down or if it was never started
 
 - 
getName@Nonnull java.util.Optional<java.lang.String> getName() - Returns:
- an Optionalcontaining the IdP Adapter name associated with this session or an empty Optional if the IdP Adapter name is null
 
 - 
getContext@Nonnull WebAuthSessionContext getContext() - Returns:
- the latest WebAuthSessionContext
 
 - 
onLoginResponsevoid onLoginResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)Push a newWebAuthResponseContextwhen the user logs in from the IdP- Parameters:
- webAuthResponseContext- the- WebAuthResponseContext
- Throws:
- java.lang.IllegalStateException- if the session is not running
 
 - 
onLogoutResponsevoid onLogoutResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)Push a newWebAuthResponseContextwhen the user logs out from the IdP- Parameters:
- webAuthResponseContext- the- WebAuthResponseContext
- Throws:
- java.lang.IllegalStateException- if the session is not running
 
 - 
logoutdefault java.util.Optional<java.lang.String> logout() Clears the user from thisWebAuthSession- Returns:
- an optional signed attributes document used as a hint to the IdP during logout
 
 - 
logoutjava.util.Optional<java.lang.String> logout(@Nullable java.lang.String message)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() WebAuthSessionChangeEvents will be posted to theEventBuswhen theWebAuthSessionhas changed. Interested parties may callEventBus.register(Object)to listen for changes.- Returns:
- the EventBusfor thisWebAuthSession
 
 
- 
 
-