Package org.keycloak.authentication
Interface RequiredActionContext
- All Known Implementing Classes:
RequiredActionContextResult
public interface RequiredActionContext
Interface that encapsulates information about the current required action
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static enum
-
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 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.
-
Method Details
-
getAction
String getAction() -
getActionUrl
Get the action URL for the required action.- Parameters:
code
- client sessino access code- Returns:
-
getActionUrl
URI getActionUrl()Get the action URL for the required action. This auto-generates the access code.- Returns:
-
form
LoginFormsProvider form()Create a Freemarker form builder that presets the user, action URI, and a generated access code- Returns:
-
getChallenge
jakarta.ws.rs.core.Response getChallenge()If challenge has been sent this returns the JAX-RS Response- Returns:
-
getEvent
EventBuilder getEvent()Current event builder being used- Returns:
-
getUser
UserModel getUser()Current user- Returns:
-
getRealm
RealmModel getRealm() -
getAuthenticationSession
AuthenticationSessionModel getAuthenticationSession() -
getConnection
ClientConnection getConnection() -
getUriInfo
jakarta.ws.rs.core.UriInfo getUriInfo() -
getSession
KeycloakSession getSession() -
getHttpRequest
HttpRequest getHttpRequest() -
getConfig
RequiredActionConfigModel getConfig()The configuration of the current required action. Returns null if the current required action is not configurable.- Returns:
-
generateCode
String generateCode()Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.- Returns:
-
getStatus
RequiredActionContext.Status getStatus() -
challenge
void challenge(jakarta.ws.rs.core.Response response) Send a challenge Response back to user- Parameters:
response
-
-
failure
void failure()Abort the authentication with an error -
success
void success()Mark this required action as successful. The required action will be removed from the UserModel -
ignore
void ignore()Ignore this required action and go onto the next, or complete the flow.
-