Class AuthenticationSessionAdapter
- java.lang.Object
- 
- org.keycloak.models.sessions.infinispan.AuthenticationSessionAdapter
 
- 
- All Implemented Interfaces:
- AuthenticationSessionModel,- CommonClientSessionModel
 
 public class AuthenticationSessionAdapter extends Object implements AuthenticationSessionModel NOTE: Calling setter doesn't automatically enlist for update- Author:
- Marek Posolda
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.sessions.CommonClientSessionModelCommonClientSessionModel.Action, CommonClientSessionModel.ExecutionStatus
 
- 
 - 
Constructor SummaryConstructors Constructor Description AuthenticationSessionAdapter(KeycloakSession session, RootAuthenticationSessionAdapter parent, String tabId, AuthenticationSessionEntity entity)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequiredAction(String action)Adds a required action to the authentication session.voidaddRequiredAction(UserModel.RequiredAction action)Adds a required action to the authentication session.voidclearAuthNotes()Clears all authentication note.voidclearClientNotes()Clears all client notes.voidclearExecutionStatus()Clears execution status of the authentication session.voidclearUserSessionNotes()Clears all user session notes.booleanequals(Object o)StringgetAction()UserModelgetAuthenticatedUser()Returns authenticated user that is associated to the authentication session.StringgetAuthNote(String name)Retrieves value of the given authentication note to the given value.ClientModelgetClient()StringgetClientNote(String name)Retrieves value of the given client note to the given value.Map<String,String>getClientNotes()Retrieves the (name, value) map of client notes.Set<String>getClientScopes()Gets client scope IDs from the authentication session.Map<String,CommonClientSessionModel.ExecutionStatus>getExecutionStatus()Returns execution status of the authentication session.RootAuthenticationSessionModelgetParentSession()Returns the root authentication session that is parent of this authentication session.StringgetProtocol()RealmModelgetRealm()StringgetRedirectUri()Set<String>getRequiredActions()Returns required actions that are attached to this client session.StringgetTabId()Map<String,String>getUserSessionNotes()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.voidremoveRequiredAction(UserModel.RequiredAction action)Removes a required action from the authentication session.voidsetAction(String action)voidsetAuthenticatedUser(UserModel user)Sets 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 Detail- 
AuthenticationSessionAdapterpublic AuthenticationSessionAdapter(KeycloakSession session, RootAuthenticationSessionAdapter parent, String tabId, AuthenticationSessionEntity entity) 
 
- 
 - 
Method Detail- 
getTabIdpublic String getTabId() - Specified by:
- getTabIdin interface- AuthenticationSessionModel
- 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()}
 
 - 
getParentSessionpublic RootAuthenticationSessionModel getParentSession() Description copied from interface:AuthenticationSessionModelReturns the root authentication session that is parent of this authentication session.- Specified by:
- getParentSessionin interface- AuthenticationSessionModel
- Returns:
- RootAuthenticationSessionModel
 
 - 
getRealmpublic RealmModel getRealm() - Specified by:
- getRealmin interface- CommonClientSessionModel
 
 - 
getClientpublic ClientModel getClient() - Specified by:
- getClientin interface- CommonClientSessionModel
 
 - 
getRedirectUripublic String getRedirectUri() - Specified by:
- getRedirectUriin interface- CommonClientSessionModel
 
 - 
setRedirectUripublic void setRedirectUri(String uri) - Specified by:
- setRedirectUriin interface- CommonClientSessionModel
 
 - 
getActionpublic String getAction() - Specified by:
- getActionin interface- CommonClientSessionModel
 
 - 
setActionpublic void setAction(String action) - Specified by:
- setActionin interface- CommonClientSessionModel
 
 - 
getClientScopespublic Set<String> getClientScopes() Description copied from interface:AuthenticationSessionModelGets client scope IDs from the authentication session.- Specified by:
- getClientScopesin interface- AuthenticationSessionModel
- Returns:
- Set<String>never returns- null.
 
 - 
setClientScopespublic void setClientScopes(Set<String> clientScopes) Description copied from interface:AuthenticationSessionModelSets client scope IDs to the authentication session.- Specified by:
- setClientScopesin interface- AuthenticationSessionModel
- Parameters:
- clientScopes-- Set<String>Can't be- null.
 
 - 
getProtocolpublic String getProtocol() - Specified by:
- getProtocolin interface- CommonClientSessionModel
 
 - 
setProtocolpublic void setProtocol(String protocol) - Specified by:
- setProtocolin interface- CommonClientSessionModel
 
 - 
getClientNotepublic String getClientNote(String name) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullif provided then the method will return- null.
- Returns:
- Stringor- nullif no client's note is set.
 
 - 
setClientNotepublic void setClientNote(String name, String value) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided the method won't have an effect.
- value-- StringIf- nullis provided the method won't have an effect.
 
 - 
removeClientNotepublic void removeClientNote(String name) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided the method won't have an effect.
 
 - 
getClientNotespublic Map<String,String> 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 interface- AuthenticationSessionModel
- Returns:
- Map<String, String>never returns- null.
 
 - 
clearClientNotespublic 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 interface- AuthenticationSessionModel
 
 - 
getAuthNotepublic String getAuthNote(String name) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided then the method will return- null.
- Returns:
- Stringor- nullif no authentication note is set.
 
 - 
setAuthNotepublic void setAuthNote(String name, String value) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided the method won't have an effect.
- value-- StringIf- nullis provided the method won't have an effect.
 
 - 
removeAuthNotepublic void removeAuthNote(String name) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided the method won't have an effect.
 
 - 
clearAuthNotespublic 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 interface- AuthenticationSessionModel
 
 - 
setUserSessionNotepublic void setUserSessionNote(String name, String value) 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 interface- AuthenticationSessionModel
- Parameters:
- name-- StringIf- nullis provided the method won't have an effect.
- value-- StringIf- nullis provided the method won't have an effect.
 
 - 
getUserSessionNotespublic Map<String,String> 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 interface- AuthenticationSessionModel
- Returns:
- Map<String, String>never returns- null
 
 - 
clearUserSessionNotespublic 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 interface- AuthenticationSessionModel
 
 - 
getRequiredActionspublic Set<String> getRequiredActions() Description copied from interface:AuthenticationSessionModelReturns required actions that are attached to this client session.- Specified by:
- getRequiredActionsin interface- AuthenticationSessionModel
- Returns:
- Set<String>Never returns- null.
 
 - 
addRequiredActionpublic void addRequiredAction(String action) Description copied from interface:AuthenticationSessionModelAdds a required action to the authentication session.- Specified by:
- addRequiredActionin interface- AuthenticationSessionModel
- Parameters:
- action-- StringCan't be- null.
 
 - 
removeRequiredActionpublic void removeRequiredAction(String action) Description copied from interface:AuthenticationSessionModelRemoves a required action from the authentication session.- Specified by:
- removeRequiredActionin interface- AuthenticationSessionModel
- Parameters:
- action-- StringCan't be- null.
 
 - 
addRequiredActionpublic void addRequiredAction(UserModel.RequiredAction action) Description copied from interface:AuthenticationSessionModelAdds a required action to the authentication session.- Specified by:
- addRequiredActionin interface- AuthenticationSessionModel
- Parameters:
- action-- UserModel.RequiredActionCan't be- null.
 
 - 
removeRequiredActionpublic void removeRequiredAction(UserModel.RequiredAction action) Description copied from interface:AuthenticationSessionModelRemoves a required action from the authentication session.- Specified by:
- removeRequiredActionin interface- AuthenticationSessionModel
- Parameters:
- action-- UserModel.RequiredActionCan't be- null.
 
 - 
getExecutionStatuspublic Map<String,CommonClientSessionModel.ExecutionStatus> getExecutionStatus() Description copied from interface:AuthenticationSessionModelReturns execution status of the authentication session.- Specified by:
- getExecutionStatusin interface- AuthenticationSessionModel
- Returns:
- Map<String, ExecutionStatus>Never returns- null.
 
 - 
setExecutionStatuspublic void setExecutionStatus(String authenticator, CommonClientSessionModel.ExecutionStatus status) Description copied from interface:AuthenticationSessionModelSets execution status of the authentication session.- Specified by:
- setExecutionStatusin interface- AuthenticationSessionModel
- Parameters:
- authenticator-- StringCan't be- null.
- status-- ExecutionStatusCan't be- null.
 
 - 
clearExecutionStatuspublic void clearExecutionStatus() Description copied from interface:AuthenticationSessionModelClears execution status of the authentication session.- Specified by:
- clearExecutionStatusin interface- AuthenticationSessionModel
 
 - 
getAuthenticatedUserpublic UserModel getAuthenticatedUser() Description copied from interface:AuthenticationSessionModelReturns authenticated user that is associated to the authentication session.- Specified by:
- getAuthenticatedUserin interface- AuthenticationSessionModel
- Returns:
- UserModelor null if there's no authenticated user.
 
 - 
setAuthenticatedUserpublic void setAuthenticatedUser(UserModel user) Description copied from interface:AuthenticationSessionModelSets authenticated user that is associated to the authentication session.- Specified by:
- setAuthenticatedUserin interface- AuthenticationSessionModel
- Parameters:
- user-- UserModelIf- nullthen- nullwill be set to the authenticated user.
 
 
- 
 
-