Interface AuthenticationUtils
-
- All Known Implementing Classes:
DefaultAuthenticationUtils
public interface AuthenticationUtils
The common utility that contains some useful methods aroundAuthentication
.- Author:
- Sunny Yu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getAuthenticatedCsrUserId()
Retrieves the id of the CSR user, if any.String
getAuthenticatedCsrUsername()
Retrieves the username of the CSR user, if any.String
getAuthenticatedCustomerId()
Retrieves the id of the authenticated customer, if any.List<String>
getAuthenticatedCustomerSegmentIds()
Retrieves the customer segment ids found on the authentication of the current security context.String
getAuthenticatedFullName()
Retrieves the full name of the authenticated user, if any.String
getAuthenticatedUsername()
Retrieves the username of the authenticated user, if any.default org.springframework.security.core.Authentication
getAuthentication()
Retrieve the current SpringAuthentication
instance associated with the current flow, if any.Map<String,Object>
getAuthenticationAttributes()
Retrieves the attributes on the currentAuthentication
.boolean
userIsAnonymous()
Checks if the authenticated user is anonymous.boolean
userIsCSR()
Checks if the authenticated user is CSR.boolean
userIsCSRAnonymous()
Checks if the authenticated user is CSR anonymous.
-
-
-
Method Detail
-
getAuthentication
@Nullable default org.springframework.security.core.Authentication getAuthentication()
Retrieve the current SpringAuthentication
instance associated with the current flow, if any.- Returns:
- The current Spring
Authentication
instance associated with the current flow
-
getAuthenticationAttributes
Map<String,Object> getAuthenticationAttributes()
Retrieves the attributes on the currentAuthentication
. This method is expected to return the attributes in a map which is generally achieved by a registeredConverter
bean.- Returns:
- the attributes, if any, on the current
Authentication
-
userIsAnonymous
boolean userIsAnonymous()
Checks if the authenticated user is anonymous.- Returns:
- true if the authenticated user is anonymous, otherwise false
-
getAuthenticatedFullName
@Nullable String getAuthenticatedFullName()
Retrieves the full name of the authenticated user, if any.- Returns:
- the full name of the authenticated user, if any
-
getAuthenticatedUsername
@Nullable String getAuthenticatedUsername()
Retrieves the username of the authenticated user, if any.- Returns:
- the username of the authenticated user, if any
-
getAuthenticatedCustomerId
@Nullable String getAuthenticatedCustomerId()
Retrieves the id of the authenticated customer, if any.- Returns:
- the id of the authenticated customer, if any
-
getAuthenticatedCustomerSegmentIds
List<String> getAuthenticatedCustomerSegmentIds()
Retrieves the customer segment ids found on the authentication of the current security context.- Returns:
- list of customer segment ids found on the authentication of the current security context
-
userIsCSR
boolean userIsCSR()
Checks if the authenticated user is CSR.- Returns:
- true if the authenticated user is CSR, otherwise false
-
userIsCSRAnonymous
boolean userIsCSRAnonymous()
Checks if the authenticated user is CSR anonymous.- Returns:
- true if the authenticated user is CSR anonymous, otherwise false
-
getAuthenticatedCsrUserId
@Nullable String getAuthenticatedCsrUserId()
Retrieves the id of the CSR user, if any.- Returns:
- the id of the CSR user, if any
-
getAuthenticatedCsrUsername
@Nullable String getAuthenticatedCsrUsername()
Retrieves the username of the CSR user, if any.- Returns:
- the username of the CSR user, if any
-
-