Package org.keycloak.authentication
Class RequiredActionContextResult
- java.lang.Object
-
- org.keycloak.authentication.RequiredActionContextResult
-
- All Implemented Interfaces:
RequiredActionContext
public class RequiredActionContextResult extends Object implements 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
Fields Modifier and Type Field Description protected AuthenticationSessionModel
authenticationSession
protected javax.ws.rs.core.Response
challenge
protected EventBuilder
eventBuilder
protected RequiredActionFactory
factory
protected HttpRequest
httpRequest
protected RealmModel
realm
protected KeycloakSession
session
protected RequiredActionContext.Status
status
protected UserModel
user
-
Constructor Summary
Constructors Constructor Description RequiredActionContextResult(AuthenticationSessionModel authSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, HttpRequest httpRequest, UserModel user, RequiredActionFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
challenge(javax.ws.rs.core.Response response)
Send a challenge Response back to uservoid
failure()
Abort the authentication with an errorLoginFormsProvider
form()
Create a Freemarker form builder that presets the user, action URI, and a generated access codeString
generateCode()
Generates access code and updates clientsession timestamp Access codes must be included in form action callbacks as a query parameter.URI
getActionUrl()
Get the action URL for the required action.URI
getActionUrl(String code)
Get the action URL for the required action.AuthenticationSessionModel
getAuthenticationSession()
javax.ws.rs.core.Response
getChallenge()
If challenge has been sent this returns the JAX-RS ResponseClientConnection
getConnection()
EventBuilder
getEvent()
Current event builder being usedRequiredActionFactory
getFactory()
HttpRequest
getHttpRequest()
RealmModel
getRealm()
KeycloakSession
getSession()
RequiredActionContext.Status
getStatus()
javax.ws.rs.core.UriInfo
getUriInfo()
UserModel
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 Detail
-
authenticationSession
protected AuthenticationSessionModel authenticationSession
-
realm
protected RealmModel realm
-
eventBuilder
protected EventBuilder eventBuilder
-
session
protected KeycloakSession session
-
status
protected RequiredActionContext.Status status
-
challenge
protected javax.ws.rs.core.Response challenge
-
httpRequest
protected HttpRequest httpRequest
-
user
protected UserModel user
-
factory
protected RequiredActionFactory factory
-
-
Constructor Detail
-
RequiredActionContextResult
public RequiredActionContextResult(AuthenticationSessionModel authSession, RealmModel realm, EventBuilder eventBuilder, KeycloakSession session, HttpRequest httpRequest, UserModel user, RequiredActionFactory factory)
-
-
Method Detail
-
getFactory
public RequiredActionFactory getFactory()
-
getEvent
public EventBuilder getEvent()
Description copied from interface:RequiredActionContext
Current event builder being used- Specified by:
getEvent
in interfaceRequiredActionContext
- Returns:
-
getUser
public UserModel getUser()
Description copied from interface:RequiredActionContext
Current user- Specified by:
getUser
in interfaceRequiredActionContext
- Returns:
-
getRealm
public RealmModel getRealm()
- Specified by:
getRealm
in interfaceRequiredActionContext
-
getAuthenticationSession
public AuthenticationSessionModel getAuthenticationSession()
- Specified by:
getAuthenticationSession
in interfaceRequiredActionContext
-
getConnection
public ClientConnection getConnection()
- Specified by:
getConnection
in interfaceRequiredActionContext
-
getUriInfo
public javax.ws.rs.core.UriInfo getUriInfo()
- Specified by:
getUriInfo
in interfaceRequiredActionContext
-
getSession
public KeycloakSession getSession()
- Specified by:
getSession
in interfaceRequiredActionContext
-
getHttpRequest
public HttpRequest getHttpRequest()
- Specified by:
getHttpRequest
in interfaceRequiredActionContext
-
getStatus
public RequiredActionContext.Status getStatus()
- Specified by:
getStatus
in interfaceRequiredActionContext
-
challenge
public void challenge(javax.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
public URI getActionUrl(String code)
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
public String 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
public URI 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
public LoginFormsProvider 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 javax.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:
-
-