Class DefaultSessionActivator
- java.lang.Object
-
- com.sun.identity.authentication.service.DefaultSessionActivator
-
- All Implemented Interfaces:
SessionActivator
- Direct Known Subclasses:
ForceAuthSessionActivator
public class DefaultSessionActivator extends Object implements SessionActivator
The default session activator: creates a new session, sets that as the current session, copies in properties from the session it's upgrading from (if appropriate) and then from the auth session into this new session, deletes the auth session and returns.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultSessionActivator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
activateSession(InternalSession session, LoginState loginState)
boolean
activateSession(LoginState loginState, SessionService sessionService, InternalSession authSession, Subject subject)
Activates the given session after successful authentication, returning the an indication of whether activation was successful.protected Subject
addSSOTokenPrincipal(Subject subject, SessionID sid)
protected InternalSession
createSession(SessionService sessionService, LoginState loginState)
protected void
putAllPropertiesFromAuthSession(InternalSession authSession, InternalSession sessionToUpdate)
protected boolean
updateSessions(InternalSession newSession, LoginState loginState, InternalSession sessionToActivate, InternalSession authSession, SessionService sessionService, Subject subject)
newSession and sessionToActivate may be the same session -- e.g. in the default case for normal or stateless tokens.
-
-
-
Field Detail
-
DEBUG
protected static final Debug DEBUG
-
-
Method Detail
-
activateSession
public boolean activateSession(LoginState loginState, SessionService sessionService, InternalSession authSession, Subject subject) throws AuthException
Description copied from interface:SessionActivator
Activates the given session after successful authentication, returning the an indication of whether activation was successful. TheLoginState
should be updated to reflect the activated session.- Specified by:
activateSession
in interfaceSessionActivator
- Parameters:
loginState
- the login state used for authentication. May be updated by the activator.sessionService
- the session service.authSession
- the session used for authentication.subject
- the authenticated subject.- Returns:
- whether activation was successful.
- Throws:
AuthException
- if an error occurs that prevents session activation.
-
updateSessions
protected boolean updateSessions(InternalSession newSession, LoginState loginState, InternalSession sessionToActivate, InternalSession authSession, SessionService sessionService, Subject subject) throws AuthException
newSession and sessionToActivate may be the same session -- e.g. in the default case for normal or stateless tokens. In other circumstances they will differ (i.e. ForceAuth).- Throws:
AuthException
-
putAllPropertiesFromAuthSession
protected void putAllPropertiesFromAuthSession(InternalSession authSession, InternalSession sessionToUpdate)
-
createSession
protected InternalSession createSession(SessionService sessionService, LoginState loginState)
-
activateSession
protected boolean activateSession(InternalSession session, LoginState loginState) throws SessionException
- Throws:
SessionException
-
-