Package org.keycloak.authentication
Class RequiredActionContextResult
java.lang.Object
org.keycloak.authentication.RequiredActionContextResult
- All Implemented Interfaces:
RequiredActionContext
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.authentication.RequiredActionContext
RequiredActionContext.KcActionStatus, RequiredActionContext.Status
-
Field Summary
Modifier and TypeFieldDescriptionprotected AuthenticationSessionModel
protected jakarta.ws.rs.core.Response
protected RequiredActionConfigModel
protected String
protected EventBuilder
protected RequiredActionFactory
protected HttpRequest
protected RealmModel
protected KeycloakSession
protected RequiredActionContext.Status
protected UserModel
-
Constructor Summary
ConstructorDescriptionRequiredActionContextResult
(AuthenticationSessionModel authSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, HttpRequest httpRequest, UserModel user, RequiredActionFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
challenge
(jakarta.ws.rs.core.Response response) Send a challenge Response back to uservoid
Abort the authentication with an error, optionally with an erroMessage.form()
Create a Freemarker form builder that presets the user, action URI, and a generated access codeGenerates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.Get the action URL for the required action.getActionUrl
(String code) Get the action URL for the required action.jakarta.ws.rs.core.Response
If challenge has been sent this returns the JAX-RS ResponseThe configuration of the current required action.getEvent()
Current event builder being usedgetRealm()
jakarta.ws.rs.core.UriInfo
getUser()
Current uservoid
ignore()
Ignore this required action and go onto the next, or complete the flow.void
success()
Mark this required action as successful.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.authentication.RequiredActionContext
failure
-
Field Details
-
authenticationSession
-
realm
-
eventBuilder
-
session
-
status
-
errorMessage
-
challenge
protected jakarta.ws.rs.core.Response challenge -
httpRequest
-
user
-
factory
-
config
-
-
Constructor Details
-
RequiredActionContextResult
public RequiredActionContextResult(AuthenticationSessionModel authSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, HttpRequest httpRequest, UserModel user, RequiredActionFactory factory)
-
-
Method Details
-
getConfig
Description copied from interface:RequiredActionContext
The configuration of the current required action. Returns null if the current required action is not configurable.- Specified by:
getConfig
in interfaceRequiredActionContext
- Returns:
-
getFactory
-
getEvent
Description copied from interface:RequiredActionContext
Current event builder being used- Specified by:
getEvent
in interfaceRequiredActionContext
- Returns:
-
getUser
Description copied from interface:RequiredActionContext
Current user- Specified by:
getUser
in interfaceRequiredActionContext
- Returns:
-
getRealm
- Specified by:
getRealm
in interfaceRequiredActionContext
-
getAuthenticationSession
- Specified by:
getAuthenticationSession
in interfaceRequiredActionContext
-
getConnection
- Specified by:
getConnection
in interfaceRequiredActionContext
-
getUriInfo
public jakarta.ws.rs.core.UriInfo getUriInfo()- Specified by:
getUriInfo
in interfaceRequiredActionContext
-
getSession
- Specified by:
getSession
in interfaceRequiredActionContext
-
getHttpRequest
- Specified by:
getHttpRequest
in interfaceRequiredActionContext
-
getStatus
- Specified by:
getStatus
in interfaceRequiredActionContext
-
getErrorMessage
- Specified by:
getErrorMessage
in interfaceRequiredActionContext
-
challenge
public void challenge(jakarta.ws.rs.core.Response response) Description copied from interface:RequiredActionContext
Send a challenge Response back to user- Specified by:
challenge
in interfaceRequiredActionContext
-
failure
Description copied from interface:RequiredActionContext
Abort the authentication with an error, optionally with an erroMessage.- Specified by:
failure
in interfaceRequiredActionContext
-
success
public void success()Description copied from interface:RequiredActionContext
Mark this required action as successful. The required action will be removed from the UserModel- Specified by:
success
in interfaceRequiredActionContext
-
ignore
public void ignore()Description copied from interface:RequiredActionContext
Ignore this required action and go onto the next, or complete the flow.- Specified by:
ignore
in interfaceRequiredActionContext
-
getAction
- Specified by:
getAction
in interfaceRequiredActionContext
-
getActionUrl
Description copied from interface:RequiredActionContext
Get the action URL for the required action.- Specified by:
getActionUrl
in interfaceRequiredActionContext
- Parameters:
code
- client sessino access code- Returns:
-
generateCode
Description copied from interface:RequiredActionContext
Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.- Specified by:
generateCode
in interfaceRequiredActionContext
- Returns:
-
getActionUrl
Description copied from interface:RequiredActionContext
Get the action URL for the required action. This auto-generates the access code.- Specified by:
getActionUrl
in interfaceRequiredActionContext
- Returns:
-
form
Description copied from interface:RequiredActionContext
Create a Freemarker form builder that presets the user, action URI, and a generated access code- Specified by:
form
in interfaceRequiredActionContext
- Returns:
-
getChallenge
public jakarta.ws.rs.core.Response getChallenge()Description copied from interface:RequiredActionContext
If challenge has been sent this returns the JAX-RS Response- Specified by:
getChallenge
in interfaceRequiredActionContext
- Returns:
-