Interface SessionManagement
-
public interface SessionManagement
Internal login sessions management- Author:
- K. Benedyczak
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SessionManagement.AttributeUpdater
Callback interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSessionParticipant(SessionParticipant... participant)
Adds given participands to the current login sessionLoginSession
createSession(long loggedEntity, pl.edu.icm.unity.types.authn.AuthenticationRealm realm, java.lang.String label, java.lang.String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, java.lang.String firstFactorOptionId, java.lang.String secondFactorOptionId)
Creates new sessionLoginSession
getCreateSession(long loggedEntity, pl.edu.icm.unity.types.authn.AuthenticationRealm realm, java.lang.String label, java.lang.String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, java.lang.String firstFactorOptionId, java.lang.String secondFactorOptionId)
Tries to find a session for the entity in the given realm.LoginSession
getOwnedSession(pl.edu.icm.unity.types.basic.EntityParam owner, java.lang.String realm)
Tries to find a session owned by a given entity in a given realm.LoginSession
getSession(java.lang.String id)
void
recordAdditionalAuthentication(java.lang.String id, java.lang.String optionId)
Records additional re-authentication fact to the sessionvoid
removeSession(java.lang.String id, boolean soft)
Removes a given session.void
updateSessionActivity(java.lang.String id)
Updates the lastUsed timestamp of a session.void
updateSessionAttributes(java.lang.String id, SessionManagement.AttributeUpdater updater)
Updates the extra attributes of the session.
-
-
-
Method Detail
-
getCreateSession
LoginSession getCreateSession(long loggedEntity, pl.edu.icm.unity.types.authn.AuthenticationRealm realm, java.lang.String label, java.lang.String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, java.lang.String firstFactorOptionId, java.lang.String secondFactorOptionId)
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.types.authn.AuthenticationRealm realm, java.lang.String label, java.lang.String outdatedCredentialId, LoginSession.RememberMeInfo rememberMeInfo, java.lang.String firstFactorOptionId, java.lang.String secondFactorOptionId)
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
void updateSessionAttributes(java.lang.String id, SessionManagement.AttributeUpdater updater)
Updates the extra attributes of the session. Update is done via callback to enable transactional access.- Parameters:
id
-
-
updateSessionActivity
void updateSessionActivity(java.lang.String id)
Updates the lastUsed timestamp of a session. The implementation may delay this action if the previous update happened recently.- Parameters:
id
-
-
recordAdditionalAuthentication
void recordAdditionalAuthentication(java.lang.String id, java.lang.String optionId)
Records additional re-authentication fact to the session- Parameters:
id
-optionId
-
-
removeSession
void removeSession(java.lang.String id, boolean soft)
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
LoginSession getSession(java.lang.String id)
- Parameters:
id
-- Returns:
- session
-
getOwnedSession
LoginSession getOwnedSession(pl.edu.icm.unity.types.basic.EntityParam owner, java.lang.String realm) throws pl.edu.icm.unity.exceptions.EngineException
Tries to find a session owned by a given entity in a given realm.- Parameters:
owner
-realm
-- Returns:
- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
addSessionParticipant
void addSessionParticipant(SessionParticipant... participant)
Adds given participands to the current login session- Parameters:
participant
-
-
-