public class SecurityUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_DENIED_EXCEPTION_SESSION_ATTRIBUTE |
static String |
AUTHENTICATION_EXCEPTION_SESSION_ATTRIBUTE |
static String |
AUTHENTICATION_REQUEST_ATTRIBUTE_NAME |
static String |
BAD_CREDENTIALS_EXCEPTION_SESSION_ATTRIBUTE |
static String |
PROFILE_LAST_MODIFIED_COOKIE_NAME |
static String |
TENANT_REQUEST_ATTRIBUTE_NAME |
static String |
TICKET_COOKIE_NAME |
Modifier and Type | Method and Description |
---|---|
static Authentication |
getAuthentication(javax.servlet.http.HttpServletRequest request)
Returns the authentication attribute from the specified request.
|
static Authentication |
getCurrentAuthentication()
Returns the authentication attribute from the current request.
|
static Profile |
getCurrentProfile()
Returns the profile from authentication attribute from the current request.
|
static Profile |
getProfile(javax.servlet.http.HttpServletRequest request)
Returns the profile from authentication attribute from the specified request.
|
static Long |
getProfileLastModifiedCookie(javax.servlet.http.HttpServletRequest request)
Returns the last modified timestamp cookie from the request.
|
static String |
getTicketCookie(javax.servlet.http.HttpServletRequest request)
Returns the ticket cookie value from the request.
|
static void |
removeAuthentication(javax.servlet.http.HttpServletRequest request)
Removes the authentication attribute from the specified request.
|
static void |
removeCurrentAuthentication()
Removes the authentication attribute from the current request.
|
static void |
setAuthentication(javax.servlet.http.HttpServletRequest request,
Authentication authentication)
Sets the authentication attribute in the specified request.
|
static void |
setCurrentAuthentication(Authentication authentication)
Sets the authentication attribute in the current request.
|
public static final String AUTHENTICATION_EXCEPTION_SESSION_ATTRIBUTE
public static final String BAD_CREDENTIALS_EXCEPTION_SESSION_ATTRIBUTE
public static final String ACCESS_DENIED_EXCEPTION_SESSION_ATTRIBUTE
public static final String TICKET_COOKIE_NAME
public static final String PROFILE_LAST_MODIFIED_COOKIE_NAME
public static final String TENANT_REQUEST_ATTRIBUTE_NAME
public static final String AUTHENTICATION_REQUEST_ATTRIBUTE_NAME
public static String getTicketCookie(javax.servlet.http.HttpServletRequest request)
request
- the request where to retrieve the ticket frompublic static Long getProfileLastModifiedCookie(javax.servlet.http.HttpServletRequest request)
request
- the request where to retrieve the last modified timestamp frompublic static Authentication getCurrentAuthentication()
public static void setCurrentAuthentication(Authentication authentication)
authentication
- the authentication object to set as request attributepublic static void removeCurrentAuthentication()
public static Authentication getAuthentication(javax.servlet.http.HttpServletRequest request)
request
- the request where to get the attribute frompublic static void setAuthentication(javax.servlet.http.HttpServletRequest request, Authentication authentication)
request
- the request where to add the attribute toauthentication
- the authentication object to set as request attributepublic static void removeAuthentication(javax.servlet.http.HttpServletRequest request)
request
- the request where to remove the attribute frompublic static Profile getCurrentProfile()
public static Profile getProfile(javax.servlet.http.HttpServletRequest request)
Copyright © 2023 CrafterCMS. All rights reserved.