Class Cas2Authenticator
java.lang.Object
org.nuxeo.ecm.platform.ui.web.auth.cas2.Cas2Authenticator
- All Implemented Interfaces:
LoginResponseHandler,NuxeoAuthenticationPlugin,NuxeoAuthenticationPluginLogoutExtension
public class Cas2Authenticator
extends Object
implements NuxeoAuthenticationPlugin, NuxeoAuthenticationPluginLogoutExtension, LoginResponseHandler
- Author:
- Thierry Delprat, Olivier Adam, M.-A. Darche, Benjamin Jalon, Thierry Martins
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected Stringprotected static final StringDeprecated.since 2023, no used anymore for security reasonsprotected static final Stringprotected Stringprotected Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected Stringprotected static final Stringprotected booleanprotected static final Stringprotected Stringprotected StringWe tell the CAS server whether we want a plain text (CAS 1.0) or XML (CAS 2.0) response by making the request either to the '...protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcheckCasTicket(String ticket, jakarta.servlet.http.HttpServletRequest httpRequest) protected StringcheckProxyCasTicket(String ticket, jakarta.servlet.http.HttpServletRequest httpRequest) protected NuxeoAuthenticationPlugingetAlternativeAuthPlugin(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected StringgetAppURL(jakarta.servlet.http.HttpServletRequest httpRequest) protected jakarta.servlet.http.Cookieprotected StringgetServiceURL(jakarta.servlet.http.HttpServletRequest httpRequest, String action) 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.handleLogout(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) Handles logout operation.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.booleanonError(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles the login error response.booleanonSuccess(jakarta.servlet.http.HttpServletRequest arg0, jakarta.servlet.http.HttpServletResponse arg1) Handles login success response.protected voidremoveCookie(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.servlet.http.Cookie cookie)
-
Field Details
-
CAS_SERVER_HEADER_KEY
Deprecated.since 2023, no used anymore for security reasons- See Also:
-
CAS_SERVER_PATTERN_KEY
- See Also:
-
NUXEO_SERVER_PATTERN_KEY
- See Also:
-
LOGIN_ACTION
- See Also:
-
LOGOUT_ACTION
- See Also:
-
VALIDATE_ACTION
- See Also:
-
PROXY_VALIDATE_ACTION
- See Also:
-
EXCLUDE_PROMPT_KEY
- See Also:
-
ALTERNATIVE_AUTH_PLUGIN_COOKIE_NAME
- See Also:
-
ticketKey
-
proxyKey
-
appURL
-
serviceLoginURL
-
serviceValidateURL
-
proxyValidateURL
We tell the CAS server whether we want a plain text (CAS 1.0) or XML (CAS 2.0) response by making the request either to the '.../validate' or '.../serviceValidate' URL. The older protocol supports only the CAS 1.0 functionality, which is left around as the legacy '.../validate' URL. -
serviceKey
-
logoutURL
-
defaultCasServer
-
ticketValidatorClassName
-
proxyValidatorClassName
-
promptLogin
protected boolean promptLogin -
excludePromptURLs
-
errorPage
-
-
Constructor Details
-
Cas2Authenticator
public Cas2Authenticator()
-
-
Method Details
-
getUnAuthenticatedURLPrefix
Description copied from interface:NuxeoAuthenticationPluginReturns the list of prefix for unauthenticated URLs, typically the URLs associated to login prompt.- Specified by:
getUnAuthenticatedURLPrefixin interfaceNuxeoAuthenticationPlugin
-
getServiceURL
-
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- Parameters:
httpRequest- the requesthttpResponse- the response- Returns:
- true if AuthFilter must stop execution (ie: login prompt generated a redirect), false otherwise
-
getAppURL
-
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- Parameters:
httpRequest- the requesthttpResponse- the response
-
initPlugin
Description copied from interface:NuxeoAuthenticationPluginInitializes the Plugin from parameters set in the XML descriptor.- Specified by:
initPluginin interfaceNuxeoAuthenticationPlugin
-
needLoginPrompt
Description copied from interface:NuxeoAuthenticationPluginDefines if the authentication plugin needs to do a login prompt.- Specified by:
needLoginPromptin interfaceNuxeoAuthenticationPlugin- Returns:
- true if LoginPrompt is used
-
handleLogout
public Boolean handleLogout(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) Description copied from interface:NuxeoAuthenticationPluginLogoutExtensionHandles logout operation.Generic logout (killing session and Seam objects) is done by LogoutActionBean This interface must be implemented by auth plugin when the target auth system needs a specific logout procedure.
- Specified by:
handleLogoutin interfaceNuxeoAuthenticationPluginLogoutExtension- Returns:
- true if caller must stop execution (ie: logout generated a redirect), false otherwise
-
checkProxyCasTicket
-
checkCasTicket
-
onError
public boolean onError(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:LoginResponseHandlerHandles the login error response.- Specified by:
onErrorin interfaceLoginResponseHandler- Parameters:
request- the HTTP requestresponse- the HTTP response- Returns:
- true if error was handled, false otherwise
-
onSuccess
public boolean onSuccess(jakarta.servlet.http.HttpServletRequest arg0, jakarta.servlet.http.HttpServletResponse arg1) Description copied from interface:LoginResponseHandlerHandles login success response.- Specified by:
onSuccessin interfaceLoginResponseHandler- Parameters:
arg0- the HTTP requestarg1- the HTTP response- Returns:
- true if response was handled, false otherwise
-
getAlternativeAuthPlugin
protected NuxeoAuthenticationPlugin getAlternativeAuthPlugin(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) -
getCookie
protected jakarta.servlet.http.Cookie getCookie(jakarta.servlet.http.HttpServletRequest httpRequest, String cookieName) -
removeCookie
protected void removeCookie(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.servlet.http.Cookie cookie)
-