Package org.keycloak.authentication
Interface AuthenticationFlowContext
- 
- All Superinterfaces:
- AbstractAuthenticationFlowContext
 - All Known Implementing Classes:
- AuthenticationProcessor.Result
 
 public interface AuthenticationFlowContext extends AbstractAuthenticationFlowContext 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 SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattachUserSession(UserSessionModel userSession)voidcancelLogin()End the flow and redirect browser based on protocol specific respones.voidclearUser()Clear the user from the flow.voidfork()Fork the current flow.voidforkWithErrorMessage(FormMessage message)Fork the current flow.voidforkWithSuccessMessage(FormMessage message)Fork the current flow.LoginFormsProviderform()Create a Freemarker form builder that presets the user, action URI, and a generated access codeURIgetActionTokenUrl(String tokenString)Get the action URL for the action token executor.URIgetActionUrl(String code)Get the action URL for the required action.List<AuthenticationSelectionOption>getAuthenticationSelections()AuthenticationSessionModelgetAuthenticationSession()AuthenticationSessionModel attached to this flowStringgetFlowPath()URIgetRefreshExecutionUrl()Get the refresh URL for the required action.URIgetRefreshUrl(boolean authSessionIdParam)Get the refresh URL for the flow.UserModelgetUser()Current user attached to this flow.voidresetFlow()Reset the current flow to the beginning and restarts it.voidresetFlow(Runnable afterResetListener)Reset the current flow to the beginning and restarts it.voidsetAuthenticationSelections(List<AuthenticationSelectionOption> credentialAuthExecMap)voidsetUser(UserModel user)Attach a specific user to this flow.- 
Methods inherited from interface org.keycloak.authentication.AbstractAuthenticationFlowContextattempted, challenge, failure, failure, failure, failureChallenge, forceChallenge, generateAccessCode, getAuthenticatorConfig, getCategoryRequirementFromCurrentFlow, getConnection, getError, getEvent, getEventDetails, getExecution, getForwardedErrorMessage, getForwardedInfoMessage, getForwardedSuccessMessage, getHttpRequest, getProtector, getRealm, getSession, getStatus, getUriInfo, getUserErrorMessage, newEvent, setForwardedInfoMessage, success
 
- 
 
- 
- 
- 
Method Detail- 
getUserUserModel getUser() Current user attached to this flow. It can return null if no user has been identified yet- Returns:
 
 - 
setUservoid setUser(UserModel user) Attach a specific user to this flow.- Parameters:
- user-
 
 - 
getAuthenticationSelectionsList<AuthenticationSelectionOption> getAuthenticationSelections() 
 - 
setAuthenticationSelectionsvoid setAuthenticationSelections(List<AuthenticationSelectionOption> credentialAuthExecMap) 
 - 
clearUservoid clearUser() Clear the user from the flow.
 - 
attachUserSessionvoid attachUserSession(UserSessionModel userSession) 
 - 
getAuthenticationSessionAuthenticationSessionModel getAuthenticationSession() AuthenticationSessionModel attached to this flow- Returns:
 
 - 
getFlowPathString getFlowPath() - Returns:
- current flow path (EG. authenticate, reset-credentials)
 
 - 
formLoginFormsProvider form() Create a Freemarker form builder that presets the user, action URI, and a generated access code- Returns:
 
 - 
getActionUrlURI getActionUrl(String code) Get the action URL for the required action.- Parameters:
- code- authentication session access code
- Returns:
 
 - 
getActionTokenUrlURI getActionTokenUrl(String tokenString) Get the action URL for the action token executor.- Parameters:
- tokenString- String representation (JWT) of action token
- Returns:
 
 - 
getRefreshExecutionUrlURI getRefreshExecutionUrl() Get the refresh URL for the required action.- Returns:
 
 - 
getRefreshUrlURI getRefreshUrl(boolean authSessionIdParam) Get the refresh URL for the flow.- Parameters:
- authSessionIdParam- will include auth_session query param for clients that don't process cookies
- Returns:
 
 - 
cancelLoginvoid cancelLogin() End the flow and redirect browser based on protocol specific respones. This should only be executed in browser-based flows.
 - 
resetFlowvoid resetFlow() Reset the current flow to the beginning and restarts it.
 - 
resetFlowvoid resetFlow(Runnable afterResetListener) Reset the current flow to the beginning and restarts it. Allows to add additional listener, which is triggered after flow restarted
 - 
forkvoid 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.
 - 
forkWithSuccessMessagevoid forkWithSuccessMessage(FormMessage message) 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
 
 - 
forkWithErrorMessagevoid forkWithErrorMessage(FormMessage message) 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
 
 
- 
 
-