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 class
AuthenticationProcessor.Result
-
Field Summary
Fields Modifier and Type Field Description protected Runnable
afterResetListener
protected org.keycloak.sessions.AuthenticationSessionModel
authenticationSession
static String
BROKER_SESSION_ID
static String
BROKER_USER_ID
protected boolean
browserFlow
protected org.keycloak.models.ClientModel
client
protected Map<String,String>
clientAuthAttributes
protected org.keycloak.common.ClientConnection
connection
static String
CURRENT_AUTHENTICATION_EXECUTION
static String
CURRENT_FLOW_PATH
protected org.keycloak.events.EventBuilder
event
protected String
flowId
protected String
flowPath
static String
FORKED_FROM
static String
FORWARDED_PASSIVE_LOGIN
protected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore
forwardedErrorMessageStore
This could be an error message forwarded from another authenticatorprotected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore
forwardedInfoMessageStore
This could be an success message forwarded from another authenticatorprotected org.keycloak.authentication.AuthenticationProcessor.ForwardedFormMessageStore
forwardedSuccessMessageStore
This could be an success message forwarded from another authenticatorstatic String
LAST_PROCESSED_EXECUTION
protected static org.jboss.logging.Logger
logger
protected org.keycloak.services.managers.BruteForceProtector
protector
protected org.keycloak.models.RealmModel
realm
protected org.jboss.resteasy.spi.HttpRequest
request
protected org.keycloak.models.KeycloakSession
session
protected javax.ws.rs.core.UriInfo
uriInfo
protected org.keycloak.models.UserSessionModel
userSession
-
Constructor Summary
Constructors Constructor Description AuthenticationProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.keycloak.models.ClientSessionContext
attachSession()
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)
javax.ws.rs.core.Response
authenticate()
javax.ws.rs.core.Response
authenticateClient()
javax.ws.rs.core.Response
authenticateOnly()
javax.ws.rs.core.Response
authenticationAction(String execution)
protected javax.ws.rs.core.Response
authenticationComplete()
void
clearAuthenticatedUser()
static org.keycloak.sessions.AuthenticationSessionModel
clone(org.keycloak.models.KeycloakSession session, org.keycloak.sessions.AuthenticationSessionModel authSession)
AuthenticationProcessor.Result
createAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.Authenticator authenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)
AuthenticationProcessor.Result
createClientAuthenticatorContext(org.keycloak.models.AuthenticationExecutionModel model, org.keycloak.authentication.ClientAuthenticator clientAuthenticator, List<org.keycloak.models.AuthenticationExecutionModel> executions)
org.keycloak.authentication.AuthenticationFlow
createFlowExecution(String flowId, org.keycloak.models.AuthenticationExecutionModel execution)
void
evaluateRequiredActionTriggers()
javax.ws.rs.core.Response
finishAuthentication(org.keycloak.protocol.LoginProtocol protocol)
String
generateCode()
org.keycloak.sessions.AuthenticationSessionModel
getAuthenticationSession()
org.keycloak.services.managers.BruteForceProtector
getBruteForceProtector()
org.keycloak.models.ClientModel
getClient()
Map<String,String>
getClientAuthAttributes()
org.keycloak.common.ClientConnection
getConnection()
org.keycloak.events.EventBuilder
getEvent()
String
getFlowPath()
org.keycloak.models.RealmModel
getRealm()
URI
getRefreshUrl(boolean authSessionIdParam)
org.jboss.resteasy.spi.HttpRequest
getRequest()
org.keycloak.models.KeycloakSession
getSession()
javax.ws.rs.core.UriInfo
getUriInfo()
org.keycloak.models.UserSessionModel
getUserSession()
javax.ws.rs.core.Response
handleBrowserException(Exception failure)
javax.ws.rs.core.Response
handleBrowserExceptionList(org.keycloak.authentication.AuthenticationFlowException e)
javax.ws.rs.core.Response
handleClientAuthException(Exception failure)
boolean
isBrowserFlow()
boolean
isSuccessful(org.keycloak.models.AuthenticationExecutionModel model)
void
logFailure()
org.keycloak.events.EventBuilder
newEvent()
String
nextRequiredAction()
javax.ws.rs.core.Response
redirectToFlow()
void
resetFlow()
static void
resetFlow(org.keycloak.sessions.AuthenticationSessionModel authSession, String flowPath)
AuthenticationProcessor
setAuthenticationSession(org.keycloak.sessions.AuthenticationSessionModel authenticationSession)
void
setAutheticatedUser(org.keycloak.models.UserModel user)
AuthenticationProcessor
setBrowserFlow(boolean browserFlow)
void
setClient(org.keycloak.models.ClientModel client)
AuthenticationProcessor
setConnection(org.keycloak.common.ClientConnection connection)
AuthenticationProcessor
setEventBuilder(org.keycloak.events.EventBuilder eventBuilder)
AuthenticationProcessor
setFlowId(String flowId)
AuthenticationProcessor
setFlowPath(String flowPath)
This is the path segment to append when generating an action URL.AuthenticationProcessor
setForwardedErrorMessage(org.keycloak.models.utils.FormMessage forwardedErrorMessage)
AuthenticationProcessor
setForwardedInfoMessage(org.keycloak.models.utils.FormMessage forwardedInfoMessage)
AuthenticationProcessor
setForwardedSuccessMessage(org.keycloak.models.utils.FormMessage forwardedSuccessMessage)
AuthenticationProcessor
setRealm(org.keycloak.models.RealmModel realm)
AuthenticationProcessor
setRequest(org.jboss.resteasy.spi.HttpRequest request)
AuthenticationProcessor
setSession(org.keycloak.models.KeycloakSession session)
AuthenticationProcessor
setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
void
validateUser(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)
-
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)
-
-