Class DefaultAuthenticationUtils
java.lang.Object
com.broadleafcommerce.resource.security.utils.service.DefaultAuthenticationUtils
- All Implemented Interfaces:
AuthenticationUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the account id found on the authentication of the current security context.Retrieves the id of the CSR user, if any.Retrieves the username of the CSR user, if any.Retrieves the id of the authenticated customer, if any.Retrieves the customer segment ids found on the authentication of the current security context.Retrieves the full name of the authenticated user, if any.Retrieves a list of all parent account ids of theAuthenticationUtils.getAuthenticatedAccountId().Retrieves the username of the authenticated user, if any.Retrieves the attributes on the currentAuthentication.protected booleanisAdminScopedServiceClient(Map<String, Object> authenticationDetails) voidsetAttributesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.core.Authentication, Map<String, Object>> attributesConverter) booleanChecks if the authenticated user is anonymous.booleanChecks if the authenticated user is CSR.booleanChecks if the authenticated user is CSR acting as neither an impersonated customer nor an anonymous customer but as themselves.booleanChecks if the authenticated user is CSR anonymous.booleanWhether or not the current user is in an admin context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
getAuthentication
-
Constructor Details
-
DefaultAuthenticationUtils
public DefaultAuthenticationUtils()
-
-
Method Details
-
setAttributesConverter
-
getAuthenticationAttributes
Description copied from interface:AuthenticationUtilsRetrieves the attributes on the currentAuthentication. This method is expected to return the attributes in a map which is generally achieved by a registeredConverterbean.- Specified by:
getAuthenticationAttributesin interfaceAuthenticationUtils- Returns:
- the attributes, if any, on the current
Authentication
-
userIsAnonymous
public boolean userIsAnonymous()Description copied from interface:AuthenticationUtilsChecks if the authenticated user is anonymous.- Specified by:
userIsAnonymousin interfaceAuthenticationUtils- Returns:
- true if the authenticated user is anonymous, otherwise false
-
getAuthenticatedFullName
Description copied from interface:AuthenticationUtilsRetrieves the full name of the authenticated user, if any.- Specified by:
getAuthenticatedFullNamein interfaceAuthenticationUtils- Returns:
- the full name of the authenticated user, if any
-
getAuthenticatedUsername
Description copied from interface:AuthenticationUtilsRetrieves the username of the authenticated user, if any.- Specified by:
getAuthenticatedUsernamein interfaceAuthenticationUtils- Returns:
- the username of the authenticated user, if any
-
getAuthenticatedCustomerId
Description copied from interface:AuthenticationUtilsRetrieves the id of the authenticated customer, if any.- Specified by:
getAuthenticatedCustomerIdin interfaceAuthenticationUtils- Returns:
- the id of the authenticated customer, if any
-
getAuthenticatedAccountId
Description copied from interface:AuthenticationUtilsRetrieves the account id found on the authentication of the current security context.- Specified by:
getAuthenticatedAccountIdin interfaceAuthenticationUtils- Returns:
- the account id found on the authentication of the current security context
-
getAuthenticatedParentAccountIds
Description copied from interface:AuthenticationUtilsRetrieves a list of all parent account ids of theAuthenticationUtils.getAuthenticatedAccountId().The returned list does not include the account id found on the authentication of the current security context.
- Specified by:
getAuthenticatedParentAccountIdsin interfaceAuthenticationUtils- Returns:
- list of all parent account ids of the
AuthenticationUtils.getAuthenticatedAccountId()
-
getAuthenticatedCustomerSegmentIds
Description copied from interface:AuthenticationUtilsRetrieves the customer segment ids found on the authentication of the current security context.- Specified by:
getAuthenticatedCustomerSegmentIdsin interfaceAuthenticationUtils- Returns:
- list of customer segment ids found on the authentication of the current security context
-
userIsCSR
public boolean userIsCSR()Description copied from interface:AuthenticationUtilsChecks if the authenticated user is CSR.- Specified by:
userIsCSRin interfaceAuthenticationUtils- Returns:
- true if the authenticated user is CSR, otherwise false
-
userIsCSRActingAsSelf
public boolean userIsCSRActingAsSelf()Description copied from interface:AuthenticationUtilsChecks if the authenticated user is CSR acting as neither an impersonated customer nor an anonymous customer but as themselves. This is used in situations such as when a CSR is managing quote requests on the storefront.- Specified by:
userIsCSRActingAsSelfin interfaceAuthenticationUtils- Returns:
- true if the authenticated user is CSR, otherwise false
-
userIsCSRAnonymous
public boolean userIsCSRAnonymous()Description copied from interface:AuthenticationUtilsChecks if the authenticated user is CSR anonymous.- Specified by:
userIsCSRAnonymousin interfaceAuthenticationUtils- Returns:
- true if the authenticated user is CSR anonymous, otherwise false
-
getAuthenticatedCsrUserId
Description copied from interface:AuthenticationUtilsRetrieves the id of the CSR user, if any.- Specified by:
getAuthenticatedCsrUserIdin interfaceAuthenticationUtils- Returns:
- the id of the CSR user, if any
-
getAuthenticatedCsrUsername
Description copied from interface:AuthenticationUtilsRetrieves the username of the CSR user, if any.- Specified by:
getAuthenticatedCsrUsernamein interfaceAuthenticationUtils- Returns:
- the username of the CSR user, if any
-
userIsInAdminContext
public boolean userIsInAdminContext()Description copied from interface:AuthenticationUtilsWhether or not the current user is in an admin context.- Specified by:
userIsInAdminContextin interfaceAuthenticationUtils- Returns:
- true if the user is in an admin context
-
isAdminScopedServiceClient
-