public class AuthenticationProcessor.Result extends Object implements AuthenticationFlowContext, ClientAuthenticationFlowContext
Modifier and Type | Method and Description |
---|---|
void |
attachUserSession(UserSessionModel userSession) |
void |
attempted()
There was no failure or challenge.
|
void |
cancelLogin()
End the flow and redirect browser based on protocol specific respones.
|
void |
challenge(javax.ws.rs.core.Response challenge)
Sends a challenge response back to the HTTP client.
|
void |
clearUser()
Clear the user from the flow.
|
void |
failure(AuthenticationFlowError error)
Aborts the current flow
|
void |
failure(AuthenticationFlowError error,
javax.ws.rs.core.Response challenge)
Aborts the current flow.
|
void |
failureChallenge(AuthenticationFlowError error,
javax.ws.rs.core.Response challenge)
Same behavior as forceChallenge(), but the error count in brute force attack detection will be incremented.
|
void |
forceChallenge(javax.ws.rs.core.Response challenge)
Sends the challenge back to the HTTP client irregardless of the current executionr requirement
|
void |
fork()
Fork the current flow.
|
void |
forkWithErrorMessage(FormMessage message)
Fork the current flow.
|
void |
forkWithSuccessMessage(FormMessage message)
Fork the current flow.
|
LoginFormsProvider |
form()
Create a Freemarker form builder that presets the user, action URI, and a generated access code
|
String |
generateAccessCode()
Generates access code and updates clientsession timestamp
Access codes must be included in form action callbacks as a query parameter.
|
URI |
getActionTokenUrl(String tokenString)
Get the action URL for the action token executor.
|
URI |
getActionUrl(String code)
Get the action URL for the required action.
|
URI |
getActionUrl(String code,
boolean authSessionIdParam)
Get the action URL for the required action.
|
List<AuthenticationSelectionOption> |
getAuthenticationSelections() |
AuthenticationSessionModel |
getAuthenticationSession()
AuthenticationSessionModel attached to this flow
|
Authenticator |
getAuthenticator() |
AuthenticatorConfigModel |
getAuthenticatorConfig()
Get any configuration associated with the current execution
|
AuthenticationExecutionModel.Requirement |
getCategoryRequirementFromCurrentFlow(String authenticatorCategory) |
javax.ws.rs.core.Response |
getChallenge() |
ClientModel |
getClient()
Current client attached to this flow.
|
Map<String,String> |
getClientAuthAttributes()
Return the map where the authenticators can put some additional state related to authenticated client and the context how was
client authenticated (ie.
|
ClientAuthenticator |
getClientAuthenticator() |
ClientConnection |
getConnection()
Information about the IP address from the connecting HTTP client.
|
AuthenticationFlowError |
getError()
Get the error condition of a failed execution.
|
FormMessage |
getErrorMessage() |
EventBuilder |
getEvent()
Current event builder being used
|
AuthenticationExecutionModel |
getExecution()
The current execution in the flow
|
String |
getFlowPath() |
FormMessage |
getForwardedErrorMessage()
This could be an error message forwarded from another authenticator that is restarting or continuing the flo.
|
FormMessage |
getForwardedSuccessMessage()
This could be an success message forwarded from another authenticator that is restarting or continuing the flow.
|
org.jboss.resteasy.spi.HttpRequest |
getHttpRequest() |
BruteForceProtector |
getProtector() |
RealmModel |
getRealm()
Current realm
|
URI |
getRefreshExecutionUrl()
Get the refresh URL for the required action.
|
URI |
getRefreshUrl(boolean authSessionIdParam)
Get the refresh URL for the flow.
|
KeycloakSession |
getSession()
Current session
|
FlowStatus |
getStatus()
Get the current status of the current execution.
|
FormMessage |
getSuccessMessage() |
javax.ws.rs.core.UriInfo |
getUriInfo()
UriInfo of the current request
|
UserModel |
getUser()
Current user attached to this flow.
|
EventBuilder |
newEvent()
Create a refresh new EventBuilder to use within this context
|
void |
resetFlow()
Reset the current flow to the beginning and restarts it.
|
void |
resetFlow(Runnable afterResetListener)
Reset the current flow to the beginning and restarts it.
|
void |
setAuthenticationSelections(List<AuthenticationSelectionOption> authenticationSelections) |
void |
setClient(ClientModel client)
Attach a specific client to this flow.
|
void |
setUser(UserModel user)
Attach a specific user to this flow.
|
void |
success()
Mark the current execution as successful.
|
public EventBuilder newEvent()
AbstractAuthenticationFlowContext
newEvent
in interface AbstractAuthenticationFlowContext
public AuthenticationExecutionModel.Requirement getCategoryRequirementFromCurrentFlow(String authenticatorCategory)
getCategoryRequirementFromCurrentFlow
in interface AbstractAuthenticationFlowContext
public AuthenticationExecutionModel getExecution()
AbstractAuthenticationFlowContext
getExecution
in interface AbstractAuthenticationFlowContext
public AuthenticatorConfigModel getAuthenticatorConfig()
AbstractAuthenticationFlowContext
getAuthenticatorConfig
in interface AbstractAuthenticationFlowContext
public Authenticator getAuthenticator()
public FlowStatus getStatus()
AbstractAuthenticationFlowContext
getStatus
in interface AbstractAuthenticationFlowContext
public ClientAuthenticator getClientAuthenticator()
public void success()
AbstractAuthenticationFlowContext
success
in interface AbstractAuthenticationFlowContext
public void failure(AuthenticationFlowError error)
AbstractAuthenticationFlowContext
failure
in interface AbstractAuthenticationFlowContext
public void challenge(javax.ws.rs.core.Response challenge)
AbstractAuthenticationFlowContext
challenge
in interface AbstractAuthenticationFlowContext
public void forceChallenge(javax.ws.rs.core.Response challenge)
AbstractAuthenticationFlowContext
forceChallenge
in interface AbstractAuthenticationFlowContext
public void failureChallenge(AuthenticationFlowError error, javax.ws.rs.core.Response challenge)
AbstractAuthenticationFlowContext
failureChallenge
in interface AbstractAuthenticationFlowContext
public void failure(AuthenticationFlowError error, javax.ws.rs.core.Response challenge)
AbstractAuthenticationFlowContext
failure
in interface AbstractAuthenticationFlowContext
challenge
- Response that will be sent back to HTTP clientpublic void attempted()
AbstractAuthenticationFlowContext
attempted
in interface AbstractAuthenticationFlowContext
public UserModel getUser()
AuthenticationFlowContext
getUser
in interface AuthenticationFlowContext
public void setUser(UserModel user)
AuthenticationFlowContext
setUser
in interface AuthenticationFlowContext
public List<AuthenticationSelectionOption> getAuthenticationSelections()
getAuthenticationSelections
in interface AuthenticationFlowContext
public void setAuthenticationSelections(List<AuthenticationSelectionOption> authenticationSelections)
setAuthenticationSelections
in interface AuthenticationFlowContext
public void clearUser()
AuthenticationFlowContext
clearUser
in interface AuthenticationFlowContext
public RealmModel getRealm()
AbstractAuthenticationFlowContext
getRealm
in interface AbstractAuthenticationFlowContext
public ClientModel getClient()
ClientAuthenticationFlowContext
getClient
in interface ClientAuthenticationFlowContext
public void setClient(ClientModel client)
ClientAuthenticationFlowContext
setClient
in interface ClientAuthenticationFlowContext
public Map<String,String> getClientAuthAttributes()
ClientAuthenticationFlowContext
getClientAuthAttributes
in interface ClientAuthenticationFlowContext
public AuthenticationSessionModel getAuthenticationSession()
AuthenticationFlowContext
getAuthenticationSession
in interface AuthenticationFlowContext
public String getFlowPath()
getFlowPath
in interface AuthenticationFlowContext
public ClientConnection getConnection()
AbstractAuthenticationFlowContext
getConnection
in interface AbstractAuthenticationFlowContext
public javax.ws.rs.core.UriInfo getUriInfo()
AbstractAuthenticationFlowContext
getUriInfo
in interface AbstractAuthenticationFlowContext
public KeycloakSession getSession()
AbstractAuthenticationFlowContext
getSession
in interface AbstractAuthenticationFlowContext
public org.jboss.resteasy.spi.HttpRequest getHttpRequest()
getHttpRequest
in interface AbstractAuthenticationFlowContext
public void attachUserSession(UserSessionModel userSession)
attachUserSession
in interface AuthenticationFlowContext
public BruteForceProtector getProtector()
getProtector
in interface AbstractAuthenticationFlowContext
public EventBuilder getEvent()
AbstractAuthenticationFlowContext
getEvent
in interface AbstractAuthenticationFlowContext
public FormMessage getForwardedErrorMessage()
AbstractAuthenticationFlowContext
getForwardedErrorMessage
in interface AbstractAuthenticationFlowContext
public String generateAccessCode()
AbstractAuthenticationFlowContext
generateAccessCode
in interface AbstractAuthenticationFlowContext
public javax.ws.rs.core.Response getChallenge()
public AuthenticationFlowError getError()
AbstractAuthenticationFlowContext
getError
in interface AbstractAuthenticationFlowContext
public LoginFormsProvider form()
AuthenticationFlowContext
form
in interface AuthenticationFlowContext
public URI getActionUrl(String code)
AuthenticationFlowContext
getActionUrl
in interface AuthenticationFlowContext
code
- authentication session access codepublic URI getActionTokenUrl(String tokenString)
AuthenticationFlowContext
getActionTokenUrl
in interface AuthenticationFlowContext
tokenString
- String representation (JWT) of action tokenpublic URI getActionUrl(String code, boolean authSessionIdParam)
AuthenticationFlowContext
getActionUrl
in interface AuthenticationFlowContext
code
- authentication session access codeauthSessionIdParam
- will include auth_session query param for clients that don't process cookiespublic URI getRefreshExecutionUrl()
AuthenticationFlowContext
getRefreshExecutionUrl
in interface AuthenticationFlowContext
public URI getRefreshUrl(boolean authSessionIdParam)
AuthenticationFlowContext
getRefreshUrl
in interface AuthenticationFlowContext
authSessionIdParam
- will include auth_session query param for clients that don't process cookiespublic void cancelLogin()
AuthenticationFlowContext
cancelLogin
in interface AuthenticationFlowContext
public void resetFlow()
AuthenticationFlowContext
resetFlow
in interface AuthenticationFlowContext
public void resetFlow(Runnable afterResetListener)
AuthenticationFlowContext
resetFlow
in interface AuthenticationFlowContext
public void fork()
AuthenticationFlowContext
fork
in interface AuthenticationFlowContext
public void forkWithSuccessMessage(FormMessage message)
AuthenticationFlowContext
forkWithSuccessMessage
in interface AuthenticationFlowContext
message
- Corresponds to raw text or a message property defined in a message bundlepublic void forkWithErrorMessage(FormMessage message)
AuthenticationFlowContext
forkWithErrorMessage
in interface AuthenticationFlowContext
message
- Corresponds to raw text or a message property defined in a message bundlepublic FormMessage getForwardedSuccessMessage()
AbstractAuthenticationFlowContext
getForwardedSuccessMessage
in interface AbstractAuthenticationFlowContext
public FormMessage getErrorMessage()
public FormMessage getSuccessMessage()
Copyright © 2020 JBoss by Red Hat. All rights reserved.