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.Clientprotected static final Stringprotected static final org.apache.logging.log4j.Loggerprotected static final Stringprotected static final Randomprotected static final longFields inherited from class org.nuxeo.ecm.platform.ui.web.auth.plugins.FormAuthenticator
loginPage, passwordKey, usernameKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanauthWasSuccessful(com.duosecurity.model.Token token) createIdentity(String username) protected com.duosecurity.Clientprotected KeyValueStoreProviderprotected StringgetRequestedUrl(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.voidinitPlugin(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 NuxeoPrincipalvalidateUserIdentity(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:NuxeoAuthenticationPluginInitializes the Plugin from parameters set in the XML descriptor.- Specified by:
initPluginin interfaceNuxeoAuthenticationPlugin- Overrides:
initPluginin classFormAuthenticator
-
handleLoginPrompt
public Boolean handleLoginPrompt(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, String baseURL) Description copied from interface:NuxeoAuthenticationPluginHandles the Login Prompt.- Specified by:
handleLoginPromptin interfaceNuxeoAuthenticationPlugin- Overrides:
handleLoginPromptin 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:NuxeoAuthenticationPluginRetrieves user identification information from the request.- Specified by:
handleRetrieveIdentityin interfaceNuxeoAuthenticationPlugin- Overrides:
handleRetrieveIdentityin classFormAuthenticator- Parameters:
httpRequest- the requesthttpResponse- the response
-
needLoginPrompt
Description copied from interface:NuxeoAuthenticationPluginDefines if the authentication plugin needs to do a login prompt.- Specified by:
needLoginPromptin interfaceNuxeoAuthenticationPlugin- Overrides:
needLoginPromptin classFormAuthenticator- Returns:
- true if LoginPrompt is used
-
getUnAuthenticatedURLPrefix
Description copied from interface:NuxeoAuthenticationPluginReturns the list of prefix for unauthenticated URLs, typically the URLs associated to login prompt.- Specified by:
getUnAuthenticatedURLPrefixin interfaceNuxeoAuthenticationPlugin- Overrides:
getUnAuthenticatedURLPrefixin 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
-