Package org.nuxeo.duoweb.authentication
Class DuoFactorsAuthenticator
java.lang.Object
org.nuxeo.ecm.platform.ui.web.auth.plugins.FormAuthenticator
org.nuxeo.duoweb.authentication.DuoFactorsAuthenticator
- All Implemented Interfaces:
NuxeoAuthenticationPlugin
Authentication filter handles two factors authentication via Duo
- Since:
- 5.9.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.duosecurity.Client
protected static final String
protected static final org.apache.logging.log4j.Logger
protected static final String
protected static final Random
protected static final long
Fields inherited from class org.nuxeo.ecm.platform.ui.web.auth.plugins.FormAuthenticator
loginPage, passwordKey, usernameKey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
authWasSuccessful
(com.duosecurity.model.Token token) createIdentity
(String username) protected com.duosecurity.Client
protected KeyValueStoreProvider
protected String
getRequestedUrl
(jakarta.servlet.http.HttpServletRequest httpRequest) Returns the list of prefix for unauthenticated URLs, typically the URLs associated to login prompt.handleLoginPrompt
(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, String baseURL) Handles the Login Prompt.handleRetrieveIdentity
(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) Retrieves user identification information from the request.void
initPlugin
(Map<String, String> parameters) Initializes the Plugin from parameters set in the XML descriptor.needLoginPrompt
(jakarta.servlet.http.HttpServletRequest httpRequest) Defines if the authentication plugin needs to do a login prompt.protected NuxeoPrincipal
validateUserIdentity
(UserIdentificationInfo userIdentity) Methods inherited from class org.nuxeo.ecm.platform.ui.web.auth.plugins.FormAuthenticator
getLoginPage
-
Field Details
-
log
protected static final org.apache.logging.log4j.Logger log -
STATE_TTL_SECONDS
protected static final long STATE_TTL_SECONDS -
KV_NAME
- See Also:
-
RANDOM
-
NX_USER_FIRST_FACTOR_CHECKED
- See Also:
-
duoClient
protected com.duosecurity.Client duoClient
-
-
Constructor Details
-
DuoFactorsAuthenticator
public DuoFactorsAuthenticator()
-
-
Method Details
-
initPlugin
Description copied from interface:NuxeoAuthenticationPlugin
Initializes the Plugin from parameters set in the XML descriptor.- Specified by:
initPlugin
in interfaceNuxeoAuthenticationPlugin
- Overrides:
initPlugin
in classFormAuthenticator
-
handleLoginPrompt
public Boolean handleLoginPrompt(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, String baseURL) Description copied from interface:NuxeoAuthenticationPlugin
Handles the Login Prompt.- Specified by:
handleLoginPrompt
in interfaceNuxeoAuthenticationPlugin
- Overrides:
handleLoginPrompt
in classFormAuthenticator
- Parameters:
httpRequest
- the requesthttpResponse
- the response- Returns:
- true if AuthFilter must stop execution (ie: login prompt generated a redirect), false otherwise
-
handleRetrieveIdentity
public UserIdentificationInfo handleRetrieveIdentity(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) Description copied from interface:NuxeoAuthenticationPlugin
Retrieves user identification information from the request.- Specified by:
handleRetrieveIdentity
in interfaceNuxeoAuthenticationPlugin
- Overrides:
handleRetrieveIdentity
in classFormAuthenticator
- Parameters:
httpRequest
- the requesthttpResponse
- the response
-
needLoginPrompt
Description copied from interface:NuxeoAuthenticationPlugin
Defines if the authentication plugin needs to do a login prompt.- Specified by:
needLoginPrompt
in interfaceNuxeoAuthenticationPlugin
- Overrides:
needLoginPrompt
in classFormAuthenticator
- Returns:
- true if LoginPrompt is used
-
getUnAuthenticatedURLPrefix
Description copied from interface:NuxeoAuthenticationPlugin
Returns the list of prefix for unauthenticated URLs, typically the URLs associated to login prompt.- Specified by:
getUnAuthenticatedURLPrefix
in interfaceNuxeoAuthenticationPlugin
- Overrides:
getUnAuthenticatedURLPrefix
in classFormAuthenticator
-
createIdentity
- Throws:
LoginException
-
authWasSuccessful
protected boolean authWasSuccessful(com.duosecurity.model.Token token) -
getClient
protected com.duosecurity.Client getClient() -
getKeyValueStore
-
validateUserIdentity
protected NuxeoPrincipal validateUserIdentity(UserIdentificationInfo userIdentity) throws LoginException - Throws:
LoginException
-
getRequestedUrl
-