Class LoginSession
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.authn.LoginSession
-
public class LoginSession extends java.lang.Object
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 Classes Modifier and Type Class Description static class
LoginSession.AuthNInfo
static class
LoginSession.RememberMeInfo
-
Constructor Summary
Constructors Constructor Description LoginSession()
LoginSession(java.lang.String id, java.util.Date started, long maxInactivity, long entityId, java.lang.String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor)
Constructs a session with relative expirationLoginSession(java.lang.String id, java.util.Date started, java.util.Date expires, long maxInactivity, long entityId, java.lang.String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor)
Construct a session with absolute expiration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAuthenticatedIdentities(java.util.Collection<java.lang.String> identity)
void
deserialize(pl.edu.icm.unity.base.token.Token token)
LoginSession.AuthNInfo
getAdditionalAuthn()
java.util.Set<java.lang.String>
getAuthenticatedIdentities()
long
getEntityId()
java.lang.String
getEntityLabel()
java.util.Date
getExpires()
java.lang.String
getId()
java.util.Date
getLastUsed()
LoginSession.AuthNInfo
getLogin1stFactor()
java.lang.String
getLogin1stFactorOptionId()
LoginSession.AuthNInfo
getLogin2ndFactor()
java.lang.String
getLogin2ndFactorOptionId()
long
getMaxInactivity()
java.lang.String
getOutdatedCredentialId()
java.lang.String
getRealm()
LoginSession.RememberMeInfo
getRememberMeInfo()
java.lang.String
getRemoteIdP()
java.util.Map<java.lang.String,java.lang.String>
getSessionData()
java.util.Date
getStarted()
byte[]
getTokenContents()
boolean
isExpiredAt(long timestamp)
boolean
isUsedOutdatedCredential()
void
setAdditionalAuthn(LoginSession.AuthNInfo additionalAuthn)
void
setEntityId(long entityId)
void
setEntityLabel(java.lang.String entityLabel)
void
setExpires(java.util.Date expires)
void
setId(java.lang.String id)
void
setLastUsed(java.util.Date lastUsed)
void
setLogin1stFactor(LoginSession.AuthNInfo login1stFactor)
void
setLogin2ndFactor(LoginSession.AuthNInfo login2ndFactor)
void
setMaxInactivity(long maxInactivity)
void
setOutdatedCredentialId(java.lang.String outdatedCredentialId)
void
setRealm(java.lang.String realm)
void
setRememberMeInfo(LoginSession.RememberMeInfo rememberMeInfo)
void
setRemoteIdP(java.lang.String remoteIdP)
void
setSessionData(java.util.Map<java.lang.String,java.lang.String> sessionData)
void
setStarted(java.util.Date started)
java.lang.String
toString()
-
-
-
Constructor Detail
-
LoginSession
public LoginSession()
-
LoginSession
public LoginSession(java.lang.String id, java.util.Date started, java.util.Date expires, long maxInactivity, long entityId, java.lang.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(java.lang.String id, java.util.Date started, long maxInactivity, long entityId, java.lang.String realm, LoginSession.RememberMeInfo rememberMeInfo, LoginSession.AuthNInfo login1stFactor, LoginSession.AuthNInfo login2ndFactor)
Constructs a session with relative expiration- Parameters:
id
-started
-maxInactivity
-entityId
-realm
-
-
-
Method Detail
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getStarted
public java.util.Date getStarted()
-
setStarted
public void setStarted(java.util.Date started)
-
getExpires
public java.util.Date getExpires()
-
setExpires
public void setExpires(java.util.Date expires)
-
getEntityId
public long getEntityId()
-
setEntityId
public void setEntityId(long entityId)
-
getRealm
public java.lang.String getRealm()
-
setRealm
public void setRealm(java.lang.String realm)
-
getSessionData
public java.util.Map<java.lang.String,java.lang.String> getSessionData()
-
setSessionData
public void setSessionData(java.util.Map<java.lang.String,java.lang.String> sessionData)
-
getLastUsed
public java.util.Date getLastUsed()
-
setLastUsed
public void setLastUsed(java.util.Date lastUsed)
-
getMaxInactivity
public long getMaxInactivity()
-
setMaxInactivity
public void setMaxInactivity(long maxInactivity)
-
getEntityLabel
public java.lang.String getEntityLabel()
-
setEntityLabel
public void setEntityLabel(java.lang.String entityLabel)
-
getAuthenticatedIdentities
public java.util.Set<java.lang.String> getAuthenticatedIdentities()
-
addAuthenticatedIdentities
public void addAuthenticatedIdentities(java.util.Collection<java.lang.String> identity)
-
getRemoteIdP
public java.lang.String getRemoteIdP()
-
setRemoteIdP
public void setRemoteIdP(java.lang.String remoteIdP)
-
getOutdatedCredentialId
public java.lang.String getOutdatedCredentialId()
-
isUsedOutdatedCredential
public boolean isUsedOutdatedCredential()
-
setOutdatedCredentialId
public void setOutdatedCredentialId(java.lang.String outdatedCredentialId)
-
getRememberMeInfo
public LoginSession.RememberMeInfo getRememberMeInfo()
-
setRememberMeInfo
public void setRememberMeInfo(LoginSession.RememberMeInfo rememberMeInfo)
-
getLogin1stFactor
public LoginSession.AuthNInfo getLogin1stFactor()
-
getLogin1stFactorOptionId
public java.lang.String getLogin1stFactorOptionId()
-
setLogin1stFactor
public void setLogin1stFactor(LoginSession.AuthNInfo login1stFactor)
-
getLogin2ndFactor
public LoginSession.AuthNInfo getLogin2ndFactor()
-
getLogin2ndFactorOptionId
public java.lang.String getLogin2ndFactorOptionId()
-
setLogin2ndFactor
public void setLogin2ndFactor(LoginSession.AuthNInfo login2ndFactor)
-
getAdditionalAuthn
public LoginSession.AuthNInfo getAdditionalAuthn()
-
setAdditionalAuthn
public void setAdditionalAuthn(LoginSession.AuthNInfo additionalAuthn)
-
isExpiredAt
public boolean isExpiredAt(long timestamp)
-
deserialize
public void deserialize(pl.edu.icm.unity.base.token.Token token)
-
getTokenContents
public byte[] getTokenContents()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-