Interface SessionManagement
public interface SessionManagement
Internal login sessions management
- Author:
- K. Benedyczak
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Callback interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSessionParticipant
(SessionParticipant... participant) Adds given participants to the current login sessioncreateSession
(long loggedEntity, pl.edu.icm.unity.base.authn.AuthenticationRealm realm, String label, String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, pl.edu.icm.unity.base.authn.AuthenticationOptionKey firstFactorOptionId, pl.edu.icm.unity.base.authn.AuthenticationOptionKey secondFactorOptionId, RemoteAuthnMetadata authnContext) Creates new sessiongetCreateSession
(long loggedEntity, pl.edu.icm.unity.base.authn.AuthenticationRealm realm, String label, String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, pl.edu.icm.unity.base.authn.AuthenticationOptionKey firstFactorOptionId, pl.edu.icm.unity.base.authn.AuthenticationOptionKey secondFactorOptionId, RemoteAuthnMetadata authnContext) Tries to find a session for the entity in the given realm.getOwnedSession
(pl.edu.icm.unity.base.entity.EntityParam owner, String realm) Tries to find a session owned by a given entity in a given realm.getSession
(String id) void
recordAdditionalAuthentication
(String id, pl.edu.icm.unity.base.authn.AuthenticationOptionKey optionId) Records additional re-authentication fact to the sessionvoid
removeSession
(String id, boolean soft) Removes a given session.void
Updates the lastUsed timestamp of a session.void
Updates the extra attributes of the session.
-
Method Details
-
getCreateSession
LoginSession getCreateSession(long loggedEntity, pl.edu.icm.unity.base.authn.AuthenticationRealm realm, String label, String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, pl.edu.icm.unity.base.authn.AuthenticationOptionKey firstFactorOptionId, pl.edu.icm.unity.base.authn.AuthenticationOptionKey secondFactorOptionId, RemoteAuthnMetadata authnContext) Tries to find a session for the entity in the given realm. If the session is not found then a new session is established.- Parameters:
loggedEntity
-realm
-label
- used only when a new session is createdoutdatedCredential
- used only if a new session is createdrememberMeInfo
- information about remember me steps inactive timeout).- Returns:
-
createSession
LoginSession createSession(long loggedEntity, pl.edu.icm.unity.base.authn.AuthenticationRealm realm, String label, String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, pl.edu.icm.unity.base.authn.AuthenticationOptionKey firstFactorOptionId, pl.edu.icm.unity.base.authn.AuthenticationOptionKey secondFactorOptionId, RemoteAuthnMetadata authnContext) Creates new session- Parameters:
loggedEntity
-realm
-label
- used only when a new session is createdoutdatedCredential
- used only if a new session is createdrememberMeInfo
- information about remember me steps- Returns:
-
updateSessionAttributes
Updates the extra attributes of the session. Update is done via callback to enable transactional access. -
updateSessionActivity
Updates the lastUsed timestamp of a session. The implementation may delay this action if the previous update happened recently. -
recordAdditionalAuthentication
void recordAdditionalAuthentication(String id, pl.edu.icm.unity.base.authn.AuthenticationOptionKey optionId) Records additional re-authentication fact to the session -
removeSession
Removes a given session. Missing session is silently ignored.- Parameters:
id
-soft
- if true then only the login data is removed from the HTTP session. Otherwise the whole session is invalidated
-
getSession
-
getOwnedSession
LoginSession getOwnedSession(pl.edu.icm.unity.base.entity.EntityParam owner, String realm) throws pl.edu.icm.unity.base.exceptions.EngineException Tries to find a session owned by a given entity in a given realm.- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
addSessionParticipant
Adds given participants to the current login session
-