Package com.atlassian.confluence.util
Class SeraphUtils
java.lang.Object
com.atlassian.confluence.util.SeraphUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRememberMeCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Principal principal) Adds a "remember me" cookie to the response for the given principal.static booleanauthenticate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Principal principal, String password) static com.atlassian.seraph.config.SecurityConfiggetConfig(jakarta.servlet.http.HttpServletRequest request) static StringgetLinkLoginURL(jakarta.servlet.http.HttpServletRequest request) Get a login URL with the original request appended as the os_destination.static StringgetLinkLoginURL(jakarta.servlet.http.HttpServletRequest request, String username) Get a login URL and append the given username so that it can be filled into the form if default login mechanism is used.static StringgetLinkLoginURLAndStripContextPath(jakarta.servlet.http.HttpServletRequest request) static StringgetLoginURL(jakarta.servlet.http.HttpServletRequest request) static StringgetOriginalURL(jakarta.servlet.http.HttpServletRequest request) static StringstripContextPathFromRequestURL(jakarta.servlet.http.HttpServletRequest request, String currentPageUrl)
-
Constructor Details
-
SeraphUtils
public SeraphUtils()
-
-
Method Details
-
getLoginURL
- Since:
- 10.0
-
getLinkLoginURL
public static String getLinkLoginURL(jakarta.servlet.http.HttpServletRequest request, String username) Get a login URL and append the given username so that it can be filled into the form if default login mechanism is used.- Parameters:
request-username-- Returns:
- the url
- Since:
- 10.0
- See Also:
-
getLinkLoginURL
Get a login URL with the original request appended as the os_destination.If the original request contains the special parameter called atl_after_login_redirect then this will be encoded as the os_destination instead of the original request.
- Parameters:
request-- Returns:
- a login link with the ultimate destination appended as os_destination.
- Since:
- 10.0
-
getLinkLoginURLAndStripContextPath
public static String getLinkLoginURLAndStripContextPath(jakarta.servlet.http.HttpServletRequest request) - Since:
- 10.0
-
stripContextPathFromRequestURL
public static String stripContextPathFromRequestURL(jakarta.servlet.http.HttpServletRequest request, String currentPageUrl) - Since:
- 10.0
-
getOriginalURL
- Since:
- 10.0
-
getConfig
public static com.atlassian.seraph.config.SecurityConfig getConfig(jakarta.servlet.http.HttpServletRequest request) - Since:
- 10.0
-
authenticate
public static boolean authenticate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Principal principal, String password) throws com.atlassian.seraph.auth.AuthenticatorException - Throws:
com.atlassian.seraph.auth.AuthenticatorException- Since:
- 10.0
-
addRememberMeCookie
public static void addRememberMeCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Principal principal) Adds a "remember me" cookie to the response for the given principal.Note this is best carried out by
Authenticator.login(HttpServletRequest, HttpServletResponse, String, String, boolean), but this method is provided as an alternative.- Since:
- 10.0
-