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 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
failure()
Abort the authentication with an errorform()
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 ResponsegetEvent()
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.
-
Field Details
-
authenticationSession
-
realm
-
eventBuilder
-
session
-
status
-
challenge
protected jakarta.ws.rs.core.Response challenge -
httpRequest
-
user
-
factory
-
-
Constructor Details
-
RequiredActionContextResult
public RequiredActionContextResult(AuthenticationSessionModel authSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, HttpRequest httpRequest, UserModel user, RequiredActionFactory factory)
-
-
Method Details
-
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
-
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
public void failure()Description copied from interface:RequiredActionContext
Abort the authentication with an error- 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
-
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:
-