public interface WebAuthSession
WebAuthSessionContext
for a given IdP based on incoming
WebAuthResponseContext
updates, Security Zones, and any other contextual information available. The
WebAuthSession notifies the listener passed during startup(Runnable)
when the WebAuthSessionContext
changes so that the listener may pull the new value by calling getContext()
.Modifier and Type | Method and Description |
---|---|
WebAuthSessionContext |
getContext() |
java.util.Optional<java.lang.String> |
getIdpId() |
void |
logout()
Clears the user from this
WebAuthSession |
void |
onLoginResponse(WebAuthResponseContext webAuthResponseContext)
Push a new
WebAuthResponseContext when the user logs in from the IdP |
void |
onLogoutResponse(WebAuthResponseContext webAuthResponseContext)
Push a new
WebAuthResponseContext when the user logs out from the IdP |
void |
shutdown()
Shut down the session.
|
void |
startup(java.lang.Runnable listener)
Start up the session.
|
void startup(@Nonnull java.lang.Runnable listener)
listener
is called for any changes
to the WebAuthSessionContext
listener
- the Runnable
which will be called when the WebAuthSessionContext
changesjava.lang.IllegalStateException
- if the session was already started or shut downvoid shutdown()
startup(Runnable)
will no longer be called when the WebAuthSessionContext
changes and the
listener's reference will be released.java.lang.IllegalStateException
- if the session was already shut down or if it was never started@Nonnull java.util.Optional<java.lang.String> getIdpId()
Optional
containing the IdP Adapter ID associated with this session or an empty Optional if
the IdP Adapter ID is null@Nonnull WebAuthSessionContext getContext()
WebAuthSessionContext
void onLoginResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)
WebAuthResponseContext
when the user logs in from the IdPwebAuthResponseContext
- the WebAuthResponseContext
java.lang.IllegalStateException
- if the session is not runningvoid onLogoutResponse(@Nonnull WebAuthResponseContext webAuthResponseContext)
WebAuthResponseContext
when the user logs out from the IdPwebAuthResponseContext
- the WebAuthResponseContext
java.lang.IllegalStateException
- if the session is not runningvoid logout()
WebAuthSession