Package org.keycloak.authentication
Interface AuthenticationFlowContext
- All Superinterfaces:
AbstractAuthenticationFlowContext
- All Known Implementing Classes:
AuthenticationProcessor.Result
This interface encapsulates information about an execution in an AuthenticationFlow. It is also used to set
the status of the execution being performed.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachUserSession
(UserSessionModel userSession) void
End the flow and redirect browser based on protocol specific respones.void
Clear the user from the flow.void
fork()
Fork the current flow.void
forkWithErrorMessage
(FormMessage message) Fork the current flow.void
forkWithSuccessMessage
(FormMessage message) Fork the current flow.form()
Create a Freemarker form builder that presets the user, action URI, and a generated access codegetActionTokenUrl
(String tokenString) Get the action URL for the action token executor.getActionUrl
(String code) Get the action URL for the required action.AuthenticationSessionModel attached to this flowGet the refresh URL for the required action.getRefreshUrl
(boolean authSessionIdParam) Get the refresh URL for the flow.getUser()
Current user attached to this flow.void
Reset the current flow to the beginning and restarts it.void
Reset the current flow to the beginning and restarts it.void
setAuthenticationSelections
(List<AuthenticationSelectionOption> credentialAuthExecMap) void
Attach a specific user to this flow.Methods inherited from interface org.keycloak.authentication.AbstractAuthenticationFlowContext
attempted, challenge, failure, failure, failure, failureChallenge, forceChallenge, generateAccessCode, getAuthenticatorConfig, getCategoryRequirementFromCurrentFlow, getConnection, getError, getEvent, getEventDetails, getExecution, getForwardedErrorMessage, getForwardedInfoMessage, getForwardedSuccessMessage, getHttpRequest, getProtector, getRealm, getSession, getStatus, getTopLevelFlow, getUriInfo, getUserErrorMessage, newEvent, setForwardedInfoMessage, success
-
Method Details
-
getUser
UserModel getUser()Current user attached to this flow. It can return null if no user has been identified yet- Returns:
-
setUser
Attach a specific user to this flow.- Parameters:
user
-
-
getAuthenticationSelections
List<AuthenticationSelectionOption> getAuthenticationSelections() -
setAuthenticationSelections
-
clearUser
void clearUser()Clear the user from the flow. -
attachUserSession
-
getAuthenticationSession
AuthenticationSessionModel getAuthenticationSession()AuthenticationSessionModel attached to this flow- Returns:
-
getFlowPath
String getFlowPath()- Returns:
- current flow path (EG. authenticate, reset-credentials)
-
form
LoginFormsProvider form()Create a Freemarker form builder that presets the user, action URI, and a generated access code- Returns:
-
getActionUrl
Get the action URL for the required action.- Parameters:
code
- authentication session access code- Returns:
-
getActionTokenUrl
Get the action URL for the action token executor.- Parameters:
tokenString
- String representation (JWT) of action token- Returns:
-
getRefreshExecutionUrl
URI getRefreshExecutionUrl()Get the refresh URL for the required action.- Returns:
-
getRefreshUrl
Get the refresh URL for the flow.- Parameters:
authSessionIdParam
- will include auth_session query param for clients that don't process cookies- Returns:
-
cancelLogin
void cancelLogin()End the flow and redirect browser based on protocol specific respones. This should only be executed in browser-based flows. -
resetFlow
void resetFlow()Reset the current flow to the beginning and restarts it. -
resetFlow
Reset the current flow to the beginning and restarts it. Allows to add additional listener, which is triggered after flow restarted -
fork
void fork()Fork the current flow. The authentication session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow. -
forkWithSuccessMessage
Fork the current flow. The authentication session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow. This method will set up a success message that will be displayed in the first page of the new flow- Parameters:
message
- Corresponds to raw text or a message property defined in a message bundle
-
forkWithErrorMessage
Fork the current flow. The authentication session will be cloned and set to point at the realm's browser login flow. The Response will be the result of this fork. The previous flow will still be set at the current execution. This is used by reset password when it sends an email. It sends an email linking to the current flow and redirects the browser to a new browser login flow. This method will set up an error message that will be displayed in the first page of the new flow- Parameters:
message
- Corresponds to raw text or a message property defined in a message bundle
-