Package org.keycloak.authentication
Class AuthenticationProcessor
- java.lang.Object
-
- org.keycloak.authentication.AuthenticationProcessor
-
- Direct Known Subclasses:
ResetCredentialsActionTokenHandler.ResetCredsAuthenticationProcessor
public class AuthenticationProcessor extends Object
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAuthenticationProcessor.Result
-
Field Summary
Fields Modifier and Type Field Description protected RunnableafterResetListenerprotected org.keycloak.sessions.AuthenticationSessionModelauthenticationSessionstatic StringBROKER_SESSION_IDstatic StringBROKER_USER_IDprotected booleanbrowserFlowprotected org.keycloak.models.ClientModelclientprotected Map<String,String>clientAuthAttributesprotected org.keycloak.common.ClientConnectionconnectionstatic StringCURRENT_AUTHENTICATION_EXECUTIONstatic StringCURRENT_FLOW_PATHprotected org.keycloak.events.EventBuildereventprotected StringflowIdprotected StringflowPathstatic StringFORKED_FROMstatic StringFORWARDED_PASSIVE_LOGINprotected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStoreforwardedErrorMessageStoreThis could be an error message forwarded from another authenticatorprotected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStoreforwardedInfoMessageStoreThis could be an success message forwarded from another authenticatorprotected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStoreforwardedSuccessMessageStoreThis could be an success message forwarded from another authenticatorstatic StringLAST_PROCESSED_EXECUTIONprotected static org.jboss.logging.Loggerloggerprotected org.keycloak.services.managers.BruteForceProtectorprotectorprotected org.keycloak.models.RealmModelrealmprotected org.jboss.resteasy.spi.HttpRequestrequestprotected org.keycloak.models.KeycloakSessionsessionprotected javax.ws.rs.core.UriInfouriInfoprotected org.keycloak.models.UserSessionModeluserSession
-
Constructor Summary
Constructors Constructor Description AuthenticationProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.keycloak.models.ClientSessionContextattachSession()static org.keycloak.models.ClientSessionContextattachSession(org.keycloak.sessions.AuthenticationSessionModel authSession, org.keycloak.models.UserSessionModel userSession, org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.common.ClientConnection connection, org.keycloak.events.EventBuilder event)javax.ws.rs.core.Responseauthenticate()javax.ws.rs.core.ResponseauthenticateClient()javax.ws.rs.core.ResponseauthenticateOnly()javax.ws.rs.core.ResponseauthenticationAction(String execution)protected javax.ws.rs.core.ResponseauthenticationComplete()voidclearAuthenticatedUser()static org.keycloak.sessions.AuthenticationSessionModelclone(org.keycloak.models.KeycloakSession session, org.keycloak.sessions.AuthenticationSessionModel authSession)AuthenticationProcessor.ResultcreateAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.Authenticator authenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)AuthenticationProcessor.ResultcreateClientAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.ClientAuthenticator clientAuthenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)org.keycloak.authentication.AuthenticationFlowcreateFlowExecution(String flowId, org.keycloak.models.AuthenticationExecutionModel execution)voidevaluateRequiredActionTriggers()javax.ws.rs.core.ResponsefinishAuthentication(org.keycloak.protocol.LoginProtocol protocol)StringgenerateCode()org.keycloak.sessions.AuthenticationSessionModelgetAuthenticationSession()org.keycloak.services.managers.BruteForceProtectorgetBruteForceProtector()org.keycloak.models.ClientModelgetClient()Map<String,String>getClientAuthAttributes()org.keycloak.common.ClientConnectiongetConnection()org.keycloak.events.EventBuildergetEvent()StringgetFlowPath()org.keycloak.models.RealmModelgetRealm()URIgetRefreshUrl(boolean authSessionIdParam)org.jboss.resteasy.spi.HttpRequestgetRequest()org.keycloak.models.KeycloakSessiongetSession()javax.ws.rs.core.UriInfogetUriInfo()org.keycloak.models.UserSessionModelgetUserSession()javax.ws.rs.core.ResponsehandleBrowserException(Exception failure)javax.ws.rs.core.ResponsehandleBrowserExceptionList(org.keycloak.authentication.AuthenticationFlowException e)javax.ws.rs.core.ResponsehandleClientAuthException(Exception failure)booleanisBrowserFlow()booleanisEvaluatedFalse(org.keycloak.models.AuthenticationExecutionModel model)booleanisEvaluatedTrue(org.keycloak.models.AuthenticationExecutionModel model)booleanisSuccessful(org.keycloak.models.AuthenticationExecutionModel model)voidlogFailure()org.keycloak.events.EventBuildernewEvent()StringnextRequiredAction()javax.ws.rs.core.ResponseredirectToFlow()voidresetFlow()static voidresetFlow(org.keycloak.sessions.AuthenticationSessionModel authSession, String flowPath)AuthenticationProcessorsetAuthenticationSession(org.keycloak.sessions.AuthenticationSessionModel authenticationSession)voidsetAutheticatedUser(org.keycloak.models.UserModel user)AuthenticationProcessorsetBrowserFlow(boolean browserFlow)voidsetClient(org.keycloak.models.ClientModel client)AuthenticationProcessorsetConnection(org.keycloak.common.ClientConnection connection)AuthenticationProcessorsetEventBuilder(org.keycloak.events.EventBuilder eventBuilder)AuthenticationProcessorsetFlowId(String flowId)AuthenticationProcessorsetFlowPath(String flowPath)This is the path segment to append when generating an action URL.AuthenticationProcessorsetForwardedErrorMessage(org.keycloak.models.utils.FormMessage forwardedErrorMessage)AuthenticationProcessorsetForwardedInfoMessage(org.keycloak.models.utils.FormMessage forwardedInfoMessage)AuthenticationProcessorsetForwardedSuccessMessage(org.keycloak.models.utils.FormMessage forwardedSuccessMessage)AuthenticationProcessorsetRealm(org.keycloak.models.RealmModel realm)AuthenticationProcessorsetRequest(org.jboss.resteasy.spi.HttpRequest request)AuthenticationProcessorsetSession(org.keycloak.models.KeycloakSession session)AuthenticationProcessorsetUriInfo(javax.ws.rs.core.UriInfo uriInfo)voidvalidateUser(org.keycloak.models.UserModel authenticatedUser)
-
-
-
Field Detail
-
CURRENT_AUTHENTICATION_EXECUTION
public static final String CURRENT_AUTHENTICATION_EXECUTION
- See Also:
- Constant Field Values
-
LAST_PROCESSED_EXECUTION
public static final String LAST_PROCESSED_EXECUTION
- See Also:
- Constant Field Values
-
CURRENT_FLOW_PATH
public static final String CURRENT_FLOW_PATH
- See Also:
- Constant Field Values
-
FORKED_FROM
public static final String FORKED_FROM
- See Also:
- Constant Field Values
-
BROKER_SESSION_ID
public static final String BROKER_SESSION_ID
- See Also:
- Constant Field Values
-
BROKER_USER_ID
public static final String BROKER_USER_ID
- See Also:
- Constant Field Values
-
FORWARDED_PASSIVE_LOGIN
public static final String FORWARDED_PASSIVE_LOGIN
- See Also:
- Constant Field Values
-
logger
protected static final org.jboss.logging.Logger logger
-
realm
protected org.keycloak.models.RealmModel realm
-
userSession
protected org.keycloak.models.UserSessionModel userSession
-
authenticationSession
protected org.keycloak.sessions.AuthenticationSessionModel authenticationSession
-
connection
protected org.keycloak.common.ClientConnection connection
-
uriInfo
protected javax.ws.rs.core.UriInfo uriInfo
-
session
protected org.keycloak.models.KeycloakSession session
-
event
protected org.keycloak.events.EventBuilder event
-
request
protected org.jboss.resteasy.spi.HttpRequest request
-
flowId
protected String flowId
-
flowPath
protected String flowPath
-
browserFlow
protected boolean browserFlow
-
protector
protected org.keycloak.services.managers.BruteForceProtector protector
-
afterResetListener
protected Runnable afterResetListener
-
forwardedErrorMessageStore
protected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore forwardedErrorMessageStore
This could be an error message forwarded from another authenticator
-
forwardedSuccessMessageStore
protected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore forwardedSuccessMessageStore
This could be an success message forwarded from another authenticator
-
forwardedInfoMessageStore
protected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore forwardedInfoMessageStore
This could be an success message forwarded from another authenticator
-
client
protected org.keycloak.models.ClientModel client
-
-
Method Detail
-
isBrowserFlow
public boolean isBrowserFlow()
-
setBrowserFlow
public AuthenticationProcessor setBrowserFlow(boolean browserFlow)
-
getBruteForceProtector
public org.keycloak.services.managers.BruteForceProtector getBruteForceProtector()
-
getRealm
public org.keycloak.models.RealmModel getRealm()
-
getClient
public org.keycloak.models.ClientModel getClient()
-
setClient
public void setClient(org.keycloak.models.ClientModel client)
-
getAuthenticationSession
public org.keycloak.sessions.AuthenticationSessionModel getAuthenticationSession()
-
getConnection
public org.keycloak.common.ClientConnection getConnection()
-
getUriInfo
public javax.ws.rs.core.UriInfo getUriInfo()
-
getSession
public org.keycloak.models.KeycloakSession getSession()
-
getUserSession
public org.keycloak.models.UserSessionModel getUserSession()
-
setRealm
public AuthenticationProcessor setRealm(org.keycloak.models.RealmModel realm)
-
setAuthenticationSession
public AuthenticationProcessor setAuthenticationSession(org.keycloak.sessions.AuthenticationSessionModel authenticationSession)
-
setConnection
public AuthenticationProcessor setConnection(org.keycloak.common.ClientConnection connection)
-
setUriInfo
public AuthenticationProcessor setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
-
setSession
public AuthenticationProcessor setSession(org.keycloak.models.KeycloakSession session)
-
setEventBuilder
public AuthenticationProcessor setEventBuilder(org.keycloak.events.EventBuilder eventBuilder)
-
setRequest
public AuthenticationProcessor setRequest(org.jboss.resteasy.spi.HttpRequest request)
-
setFlowId
public AuthenticationProcessor setFlowId(String flowId)
-
setFlowPath
public AuthenticationProcessor setFlowPath(String flowPath)
This is the path segment to append when generating an action URL.- Parameters:
flowPath-
-
setForwardedErrorMessage
public AuthenticationProcessor setForwardedErrorMessage(org.keycloak.models.utils.FormMessage forwardedErrorMessage)
-
setForwardedSuccessMessage
public AuthenticationProcessor setForwardedSuccessMessage(org.keycloak.models.utils.FormMessage forwardedSuccessMessage)
-
setForwardedInfoMessage
public AuthenticationProcessor setForwardedInfoMessage(org.keycloak.models.utils.FormMessage forwardedInfoMessage)
-
generateCode
public String generateCode()
-
newEvent
public org.keycloak.events.EventBuilder newEvent()
-
getEvent
public org.keycloak.events.EventBuilder getEvent()
-
getRequest
public org.jboss.resteasy.spi.HttpRequest getRequest()
-
getFlowPath
public String getFlowPath()
-
setAutheticatedUser
public void setAutheticatedUser(org.keycloak.models.UserModel user)
-
clearAuthenticatedUser
public void clearAuthenticatedUser()
-
getRefreshUrl
public URI getRefreshUrl(boolean authSessionIdParam)
-
logFailure
public void logFailure()
-
isSuccessful
public boolean isSuccessful(org.keycloak.models.AuthenticationExecutionModel model)
-
isEvaluatedTrue
public boolean isEvaluatedTrue(org.keycloak.models.AuthenticationExecutionModel model)
-
isEvaluatedFalse
public boolean isEvaluatedFalse(org.keycloak.models.AuthenticationExecutionModel model)
-
handleBrowserExceptionList
public javax.ws.rs.core.Response handleBrowserExceptionList(org.keycloak.authentication.AuthenticationFlowException e)
-
handleBrowserException
public javax.ws.rs.core.Response handleBrowserException(Exception failure)
-
handleClientAuthException
public javax.ws.rs.core.Response handleClientAuthException(Exception failure)
-
createFlowExecution
public org.keycloak.authentication.AuthenticationFlow createFlowExecution(String flowId, org.keycloak.models.AuthenticationExecutionModel execution)
-
authenticate
public javax.ws.rs.core.Response authenticate() throws org.keycloak.authentication.AuthenticationFlowException- Throws:
org.keycloak.authentication.AuthenticationFlowException
-
authenticateClient
public javax.ws.rs.core.Response authenticateClient() throws org.keycloak.authentication.AuthenticationFlowException- Throws:
org.keycloak.authentication.AuthenticationFlowException
-
redirectToFlow
public javax.ws.rs.core.Response redirectToFlow()
-
resetFlow
public void resetFlow()
-
resetFlow
public static void resetFlow(org.keycloak.sessions.AuthenticationSessionModel authSession, String flowPath)
-
clone
public static org.keycloak.sessions.AuthenticationSessionModel clone(org.keycloak.models.KeycloakSession session, org.keycloak.sessions.AuthenticationSessionModel authSession)
-
authenticationAction
public javax.ws.rs.core.Response authenticationAction(String execution)
-
authenticateOnly
public javax.ws.rs.core.Response authenticateOnly() throws org.keycloak.authentication.AuthenticationFlowException- Throws:
org.keycloak.authentication.AuthenticationFlowException
-
attachSession
public org.keycloak.models.ClientSessionContext attachSession()
-
attachSession
public static org.keycloak.models.ClientSessionContext attachSession(org.keycloak.sessions.AuthenticationSessionModel authSession, org.keycloak.models.UserSessionModel userSession, org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.common.ClientConnection connection, org.keycloak.events.EventBuilder event)
-
evaluateRequiredActionTriggers
public void evaluateRequiredActionTriggers()
-
finishAuthentication
public javax.ws.rs.core.Response finishAuthentication(org.keycloak.protocol.LoginProtocol protocol)
-
validateUser
public void validateUser(org.keycloak.models.UserModel authenticatedUser)
-
authenticationComplete
protected javax.ws.rs.core.Response authenticationComplete()
-
nextRequiredAction
public String nextRequiredAction()
-
createAuthenticatorContext
public AuthenticationProcessor.Result createAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.Authenticator authenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)
-
createClientAuthenticatorContext
public AuthenticationProcessor.Result createClientAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.ClientAuthenticator clientAuthenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)
-
-