Class LoginSession
java.lang.Object
pl.edu.icm.unity.engine.api.authn.LoginSession
Represents login session. Session expiration can be stored in two ways: either
to expire after a certain time of inactivity is reached or when an absolute point in time is reached.
The first case is the typical one. The latter is used when user's session should be preserved between
browser shutdowns.
In the absolute termination time the maxInactivity time is also used, but only after the absolute expiration time has passed. This prevents killing such session when it is being used.
- Author:
- K. Benedyczak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionLoginSession(String id, Date started, long maxInactivity, long entityId, String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor) Constructs a session with relative expirationLoginSession(String id, Date started, Date expires, long maxInactivity, long entityId, String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor) Construct a session with absolute expiration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthenticatedIdentities(Collection<String> identity) voiddeserialize(pl.edu.icm.unity.base.token.Token token) longgetId()pl.edu.icm.unity.base.authn.AuthenticationOptionKeypl.edu.icm.unity.base.authn.AuthenticationOptionKeylonggetRealm()byte[]booleanisExpiredAt(long timestamp) booleanvoidsetAdditionalAuthn(LoginSession.AuthNInfo additionalAuthn) voidsetEntityId(long entityId) voidsetEntityLabel(String entityLabel) voidsetExpires(Date expires) voidsetFirstFactorRemoteIdPAuthnContext(RemoteAuthnMetadata firstFactorRemoteIdPAuthnContext) voidvoidsetLastUsed(Date lastUsed) voidsetLogin1stFactor(LoginSession.AuthNInfo login1stFactor) voidsetLogin2ndFactor(LoginSession.AuthNInfo login2ndFactor) voidsetMaxInactivity(long maxInactivity) voidsetOutdatedCredentialId(String outdatedCredentialId) voidvoidsetRememberMeInfo(LoginSession.RememberMeInfo rememberMeInfo) voidsetRemoteIdP(String remoteIdP) voidsetSessionData(Map<String, String> sessionData) voidsetStarted(Date started) toString()
-
Constructor Details
-
LoginSession
public LoginSession() -
LoginSession
public LoginSession(String id, Date started, Date expires, long maxInactivity, long entityId, String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor) Construct a session with absolute expiration.- Parameters:
id-started-expires-maxInactivity-entityId-realm-
-
LoginSession
public LoginSession(String id, Date started, long maxInactivity, long entityId, String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor) Constructs a session with relative expiration- Parameters:
id-started-maxInactivity-entityId-realm-
-
-
Method Details
-
getId
-
setId
-
getStarted
-
setStarted
-
getExpires
-
setExpires
-
getEntityId
public long getEntityId() -
setEntityId
public void setEntityId(long entityId) -
getRealm
-
setRealm
-
getSessionData
-
setSessionData
-
getLastUsed
-
setLastUsed
-
getMaxInactivity
public long getMaxInactivity() -
setMaxInactivity
public void setMaxInactivity(long maxInactivity) -
getEntityLabel
-
setEntityLabel
-
getAuthenticatedIdentities
-
addAuthenticatedIdentities
-
getRemoteIdP
-
setRemoteIdP
-
getOutdatedCredentialId
-
isUsedOutdatedCredential
public boolean isUsedOutdatedCredential() -
setOutdatedCredentialId
-
getRememberMeInfo
-
setRememberMeInfo
-
getLogin1stFactor
-
getLogin1stFactorOptionId
public pl.edu.icm.unity.base.authn.AuthenticationOptionKey getLogin1stFactorOptionId() -
setLogin1stFactor
-
getLogin2ndFactor
-
getLogin2ndFactorOptionId
public pl.edu.icm.unity.base.authn.AuthenticationOptionKey getLogin2ndFactorOptionId() -
setLogin2ndFactor
-
getAdditionalAuthn
-
setAdditionalAuthn
-
isExpiredAt
public boolean isExpiredAt(long timestamp) -
getFirstFactorRemoteIdPAuthnContext
-
setFirstFactorRemoteIdPAuthnContext
public void setFirstFactorRemoteIdPAuthnContext(RemoteAuthnMetadata firstFactorRemoteIdPAuthnContext) -
deserialize
public void deserialize(pl.edu.icm.unity.base.token.Token token) -
getTokenContents
public byte[] getTokenContents() -
toString
-