Class AuthenticationSessionAdapter
java.lang.Object
org.keycloak.models.sessions.infinispan.AuthenticationSessionAdapter
- All Implemented Interfaces:
AuthenticationSessionModel,CommonClientSessionModel
NOTE: Calling setter doesn't automatically enlist for update
- Author:
- Marek Posolda
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.sessions.CommonClientSessionModel
CommonClientSessionModel.Action, CommonClientSessionModel.ExecutionStatus -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationSessionAdapter(KeycloakSession session, RootAuthenticationSessionModel parent, SessionEntityUpdater<AuthenticationSessionEntity> updater, String tabId) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequiredAction(String action) Adds a required action to the authentication session.voidAdds a required action to the authentication session.voidClears all authentication note.voidClears all client notes.voidClears execution status of the authentication session.voidClears all user session notes.booleanReturns authenticated user that is associated to the authentication session.getAuthNote(String name) Retrieves value of the given authentication note to the given value.getClientNote(String name) Retrieves value of the given client note to the given value.Retrieves the (name, value) map of client notes.Gets client scope IDs from the authentication session.Returns execution status of the authentication session.Returns the root authentication session that is parent of this authentication session.getRealm()Returns required actions (aliases) that are attached to this client session.getTabId()Retrieves value of given user session note.inthashCode()voidremoveAuthNote(String name) Removes the given authentication note.voidremoveClientNote(String name) Removes the given client note.voidremoveRequiredAction(String action) Removes a required action from the authentication session.voidRemoves a required action from the authentication session.voidvoidSets authenticated user that is associated to the authentication session.voidsetAuthNote(String name, String value) Sets the given authentication note to the given value.voidsetClientNote(String name, String value) Sets the given client note to the given value.voidsetClientScopes(Set<String> clientScopes) Sets client scope IDs to the authentication session.voidsetExecutionStatus(String authenticator, CommonClientSessionModel.ExecutionStatus status) Sets execution status of the authentication session.voidsetProtocol(String protocol) voidsetRedirectUri(String uri) voidsetUserSessionNote(String name, String value) Sets the given user session note to the given value.
-
Constructor Details
-
AuthenticationSessionAdapter
public AuthenticationSessionAdapter(KeycloakSession session, RootAuthenticationSessionModel parent, SessionEntityUpdater<AuthenticationSessionEntity> updater, String tabId)
-
-
Method Details
-
getTabId
- Specified by:
getTabIdin interfaceAuthenticationSessionModel- Returns:
- ID of this subsession (in other words, usually browser tab). For lookup the AuthenticationSessionModel, you need: ID of rootSession (parent), client UUID and tabId. For lookup the ID of the parent, use {@link #getParentSession().getId()}
-
getParentSession
Description copied from interface:AuthenticationSessionModelReturns the root authentication session that is parent of this authentication session.- Specified by:
getParentSessionin interfaceAuthenticationSessionModel- Returns:
RootAuthenticationSessionModel
-
getRealm
- Specified by:
getRealmin interfaceCommonClientSessionModel
-
getClient
- Specified by:
getClientin interfaceCommonClientSessionModel
-
getRedirectUri
- Specified by:
getRedirectUriin interfaceCommonClientSessionModel
-
setRedirectUri
- Specified by:
setRedirectUriin interfaceCommonClientSessionModel
-
getAction
- Specified by:
getActionin interfaceCommonClientSessionModel
-
setAction
- Specified by:
setActionin interfaceCommonClientSessionModel
-
getClientScopes
Description copied from interface:AuthenticationSessionModelGets client scope IDs from the authentication session.- Specified by:
getClientScopesin interfaceAuthenticationSessionModel- Returns:
Set<String>never returnsnull.
-
setClientScopes
Description copied from interface:AuthenticationSessionModelSets client scope IDs to the authentication session.- Specified by:
setClientScopesin interfaceAuthenticationSessionModel- Parameters:
clientScopes-Set<String>Can't benull.
-
getProtocol
- Specified by:
getProtocolin interfaceCommonClientSessionModel
-
setProtocol
- Specified by:
setProtocolin interfaceCommonClientSessionModel
-
getClientNote
Description copied from interface:AuthenticationSessionModelRetrieves value of the given client note to the given value. Client notes are notes specific to client protocol. They are NOT cleared when authentication session is restarted.- Specified by:
getClientNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullif provided then the method will returnnull.- Returns:
Stringornullif no client's note is set.
-
setClientNote
Description copied from interface:AuthenticationSessionModelSets the given client note to the given value. Client notes are notes specific to client protocol. They are NOT cleared when authentication session is restarted.- Specified by:
setClientNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided the method won't have an effect.value-StringIfnullis provided the method won't have an effect.
-
removeClientNote
Description copied from interface:AuthenticationSessionModelRemoves the given client note. Client notes are notes specific to client protocol. They are NOT cleared when authentication session is restarted.- Specified by:
removeClientNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided the method won't have an effect.
-
getClientNotes
Description copied from interface:AuthenticationSessionModelRetrieves the (name, value) map of client notes. Client notes are notes specific to client protocol. They are NOT cleared when authentication session is restarted.- Specified by:
getClientNotesin interfaceAuthenticationSessionModel- Returns:
Map<String, String>never returnsnull.
-
clearClientNotes
public void clearClientNotes()Description copied from interface:AuthenticationSessionModelClears all client notes. Client notes are notes specific to client protocol. They are NOT cleared when authentication session is restarted.- Specified by:
clearClientNotesin interfaceAuthenticationSessionModel
-
getAuthNote
Description copied from interface:AuthenticationSessionModelRetrieves value of the given authentication note to the given value. Authentication notes are notes used typically by authenticators and authentication flows. They are cleared when authentication session is restarted.- Specified by:
getAuthNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided then the method will returnnull.- Returns:
Stringornullif no authentication note is set.
-
setAuthNote
Description copied from interface:AuthenticationSessionModelSets the given authentication note to the given value. Authentication notes are notes used typically by authenticators and authentication flows. They are cleared when authentication session is restarted.- Specified by:
setAuthNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided the method won't have an effect.value-StringIfnullis provided the method won't have an effect.
-
removeAuthNote
Description copied from interface:AuthenticationSessionModelRemoves the given authentication note. Authentication notes are notes used typically by authenticators and authentication flows. They are cleared when authentication session is restarted.- Specified by:
removeAuthNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided the method won't have an effect.
-
clearAuthNotes
public void clearAuthNotes()Description copied from interface:AuthenticationSessionModelClears all authentication note. Authentication notes are notes used typically by authenticators and authentication flows. They are cleared when authentication session is restarted.- Specified by:
clearAuthNotesin interfaceAuthenticationSessionModel
-
setUserSessionNote
Description copied from interface:AuthenticationSessionModelSets the given user session note to the given value. User session notes are notes you want be applied to the UserSessionModel when the client session is attached to it.- Specified by:
setUserSessionNotein interfaceAuthenticationSessionModel- Parameters:
name-StringIfnullis provided the method won't have an effect.value-StringIfnullis provided the method won't have an effect.
-
getUserSessionNotes
Description copied from interface:AuthenticationSessionModelRetrieves value of given user session note. User session notes are notes you want be applied to the UserSessionModel when the client session is attached to it.- Specified by:
getUserSessionNotesin interfaceAuthenticationSessionModel- Returns:
Map<String, String>never returnsnull
-
clearUserSessionNotes
public void clearUserSessionNotes()Description copied from interface:AuthenticationSessionModelClears all user session notes. User session notes are notes you want be applied to the UserSessionModel when the client session is attached to it.- Specified by:
clearUserSessionNotesin interfaceAuthenticationSessionModel
-
getRequiredActions
Description copied from interface:AuthenticationSessionModelReturns required actions (aliases) that are attached to this client session.- Specified by:
getRequiredActionsin interfaceAuthenticationSessionModel- Returns:
Set<String>Never returnsnull.
-
addRequiredAction
Description copied from interface:AuthenticationSessionModelAdds a required action to the authentication session.- Specified by:
addRequiredActionin interfaceAuthenticationSessionModel- Parameters:
action-StringCan't benull.
-
removeRequiredAction
Description copied from interface:AuthenticationSessionModelRemoves a required action from the authentication session.- Specified by:
removeRequiredActionin interfaceAuthenticationSessionModel- Parameters:
action-StringCan't benull.
-
addRequiredAction
Description copied from interface:AuthenticationSessionModelAdds a required action to the authentication session.- Specified by:
addRequiredActionin interfaceAuthenticationSessionModel- Parameters:
action-UserModel.RequiredActionCan't benull.
-
removeRequiredAction
Description copied from interface:AuthenticationSessionModelRemoves a required action from the authentication session.- Specified by:
removeRequiredActionin interfaceAuthenticationSessionModel- Parameters:
action-UserModel.RequiredActionCan't benull.
-
getExecutionStatus
Description copied from interface:AuthenticationSessionModelReturns execution status of the authentication session.- Specified by:
getExecutionStatusin interfaceAuthenticationSessionModel- Returns:
Map<String, ExecutionStatus>Never returnsnull.
-
setExecutionStatus
public void setExecutionStatus(String authenticator, CommonClientSessionModel.ExecutionStatus status) Description copied from interface:AuthenticationSessionModelSets execution status of the authentication session.- Specified by:
setExecutionStatusin interfaceAuthenticationSessionModel- Parameters:
authenticator-StringCan't benull.status-ExecutionStatusCan't benull.
-
clearExecutionStatus
public void clearExecutionStatus()Description copied from interface:AuthenticationSessionModelClears execution status of the authentication session.- Specified by:
clearExecutionStatusin interfaceAuthenticationSessionModel
-
getAuthenticatedUser
Description copied from interface:AuthenticationSessionModelReturns authenticated user that is associated to the authentication session.- Specified by:
getAuthenticatedUserin interfaceAuthenticationSessionModel- Returns:
UserModelor null if there's no authenticated user.
-
setAuthenticatedUser
Description copied from interface:AuthenticationSessionModelSets authenticated user that is associated to the authentication session.- Specified by:
setAuthenticatedUserin interfaceAuthenticationSessionModel- Parameters:
user-UserModelIfnullthennullwill be set to the authenticated user.
-
equals
-
hashCode
public int hashCode()
-