public class AuthenticationSessionAdapter extends Object implements AuthenticationSessionModel
CommonClientSessionModel.Action, CommonClientSessionModel.ExecutionStatus
Constructor and Description |
---|
AuthenticationSessionAdapter(KeycloakSession session,
RootAuthenticationSessionAdapter parent,
String tabId,
AuthenticationSessionEntity entity) |
Modifier and Type | Method and Description |
---|---|
void |
addRequiredAction(String action)
Adds a required action to the authentication session.
|
void |
addRequiredAction(UserModel.RequiredAction action)
Adds a required action to the authentication session.
|
void |
clearAuthNotes()
Clears all authentication note.
|
void |
clearClientNotes()
Clears all client notes.
|
void |
clearExecutionStatus()
Clears execution status of the authentication session.
|
void |
clearUserSessionNotes()
Clears all user session notes.
|
boolean |
equals(Object o) |
String |
getAction() |
UserModel |
getAuthenticatedUser()
Returns authenticated user that is associated to the authentication session.
|
String |
getAuthNote(String name)
Retrieves value of the given authentication note to the given value.
|
ClientModel |
getClient() |
String |
getClientNote(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.
|
RootAuthenticationSessionModel |
getParentSession()
Returns the root authentication session that is parent of this authentication session.
|
String |
getProtocol() |
RealmModel |
getRealm() |
String |
getRedirectUri() |
Set<String> |
getRequiredActions()
Returns required actions that are attached to this client session.
|
String |
getTabId() |
Map<String,String> |
getUserSessionNotes()
Retrieves value of given user session note.
|
int |
hashCode() |
void |
removeAuthNote(String name)
Removes the given authentication note.
|
void |
removeClientNote(String name)
Removes the given client note.
|
void |
removeRequiredAction(String action)
Removes a required action from the authentication session.
|
void |
removeRequiredAction(UserModel.RequiredAction action)
Removes a required action from the authentication session.
|
void |
setAction(String action) |
void |
setAuthenticatedUser(UserModel user)
Sets authenticated user that is associated to the authentication session.
|
void |
setAuthNote(String name,
String value)
Sets the given authentication note to the given value.
|
void |
setClientNote(String name,
String value)
Sets the given client note to the given value.
|
void |
setClientScopes(Set<String> clientScopes)
Sets client scope IDs to the authentication session.
|
void |
setExecutionStatus(String authenticator,
CommonClientSessionModel.ExecutionStatus status)
Sets execution status of the authentication session.
|
void |
setProtocol(String protocol) |
void |
setRedirectUri(String uri) |
void |
setUserSessionNote(String name,
String value)
Sets the given user session note to the given value.
|
public AuthenticationSessionAdapter(KeycloakSession session, RootAuthenticationSessionAdapter parent, String tabId, AuthenticationSessionEntity entity)
public String getTabId()
getTabId
in interface AuthenticationSessionModel
#getParentSession().getId()
public RootAuthenticationSessionModel getParentSession()
AuthenticationSessionModel
getParentSession
in interface AuthenticationSessionModel
RootAuthenticationSessionModel
public RealmModel getRealm()
getRealm
in interface CommonClientSessionModel
public ClientModel getClient()
getClient
in interface CommonClientSessionModel
public String getRedirectUri()
getRedirectUri
in interface CommonClientSessionModel
public void setRedirectUri(String uri)
setRedirectUri
in interface CommonClientSessionModel
public String getAction()
getAction
in interface CommonClientSessionModel
public void setAction(String action)
setAction
in interface CommonClientSessionModel
public Set<String> getClientScopes()
AuthenticationSessionModel
getClientScopes
in interface AuthenticationSessionModel
Set<String>
never returns null
.public void setClientScopes(Set<String> clientScopes)
AuthenticationSessionModel
setClientScopes
in interface AuthenticationSessionModel
clientScopes
- Set<String>
Can't be null
.public String getProtocol()
getProtocol
in interface CommonClientSessionModel
public void setProtocol(String protocol)
setProtocol
in interface CommonClientSessionModel
public String getClientNote(String name)
AuthenticationSessionModel
getClientNote
in interface AuthenticationSessionModel
name
- String
If null
if provided then the method will return null
.String
or null
if no client's note is set.public void setClientNote(String name, String value)
AuthenticationSessionModel
setClientNote
in interface AuthenticationSessionModel
name
- String
If null
is provided the method won't have an effect.value
- String
If null
is provided the method won't have an effect.public void removeClientNote(String name)
AuthenticationSessionModel
removeClientNote
in interface AuthenticationSessionModel
name
- String
If null
is provided the method won't have an effect.public Map<String,String> getClientNotes()
AuthenticationSessionModel
getClientNotes
in interface AuthenticationSessionModel
Map<String, String>
never returns null
.public void clearClientNotes()
AuthenticationSessionModel
clearClientNotes
in interface AuthenticationSessionModel
public String getAuthNote(String name)
AuthenticationSessionModel
getAuthNote
in interface AuthenticationSessionModel
name
- String
If null
if provided then the method will return null
.String
or null
if no authentication note is set.public void setAuthNote(String name, String value)
AuthenticationSessionModel
setAuthNote
in interface AuthenticationSessionModel
name
- String
If null
is provided the method won't have an effect.value
- String
If null
is provided the method won't have an effect.public void removeAuthNote(String name)
AuthenticationSessionModel
removeAuthNote
in interface AuthenticationSessionModel
name
- String
If null
is provided the method won't have an effect.public void clearAuthNotes()
AuthenticationSessionModel
clearAuthNotes
in interface AuthenticationSessionModel
public void setUserSessionNote(String name, String value)
AuthenticationSessionModel
setUserSessionNote
in interface AuthenticationSessionModel
name
- String
If null
is provided the method won't have an effect.value
- String
If null
is provided the method won't have an effect.public Map<String,String> getUserSessionNotes()
AuthenticationSessionModel
getUserSessionNotes
in interface AuthenticationSessionModel
Map<String, String>
never returns null
public void clearUserSessionNotes()
AuthenticationSessionModel
clearUserSessionNotes
in interface AuthenticationSessionModel
public Set<String> getRequiredActions()
AuthenticationSessionModel
getRequiredActions
in interface AuthenticationSessionModel
Set<String>
Never returns null
.public void addRequiredAction(String action)
AuthenticationSessionModel
addRequiredAction
in interface AuthenticationSessionModel
action
- String
Can't be null
.public void removeRequiredAction(String action)
AuthenticationSessionModel
removeRequiredAction
in interface AuthenticationSessionModel
action
- String
Can't be null
.public void addRequiredAction(UserModel.RequiredAction action)
AuthenticationSessionModel
addRequiredAction
in interface AuthenticationSessionModel
action
- UserModel.RequiredAction
Can't be null
.public void removeRequiredAction(UserModel.RequiredAction action)
AuthenticationSessionModel
removeRequiredAction
in interface AuthenticationSessionModel
action
- UserModel.RequiredAction
Can't be null
.public Map<String,CommonClientSessionModel.ExecutionStatus> getExecutionStatus()
AuthenticationSessionModel
getExecutionStatus
in interface AuthenticationSessionModel
Map<String, ExecutionStatus>
Never returns null
.public void setExecutionStatus(String authenticator, CommonClientSessionModel.ExecutionStatus status)
AuthenticationSessionModel
setExecutionStatus
in interface AuthenticationSessionModel
authenticator
- String
Can't be null
.status
- ExecutionStatus
Can't be null
.public void clearExecutionStatus()
AuthenticationSessionModel
clearExecutionStatus
in interface AuthenticationSessionModel
public UserModel getAuthenticatedUser()
AuthenticationSessionModel
getAuthenticatedUser
in interface AuthenticationSessionModel
UserModel
or null if there's no authenticated user.public void setAuthenticatedUser(UserModel user)
AuthenticationSessionModel
setAuthenticatedUser
in interface AuthenticationSessionModel
user
- UserModel
If null
then null
will be set to the authenticated user.Copyright © 2021 JBoss by Red Hat. All rights reserved.