Class DefaultAuthenticationUtils

java.lang.Object
com.broadleafcommerce.resource.security.utils.service.DefaultAuthenticationUtils
All Implemented Interfaces:
AuthenticationUtils

public class DefaultAuthenticationUtils extends Object implements AuthenticationUtils
  • Constructor Details

    • DefaultAuthenticationUtils

      public DefaultAuthenticationUtils()
  • Method Details

    • setAttributesConverter

      @Autowired(required=false) @Qualifier("authenticationAttributesConverter") public void setAttributesConverter(@Nullable org.springframework.core.convert.converter.Converter<org.springframework.security.core.Authentication,Map<String,Object>> attributesConverter)
    • getAuthenticationAttributes

      public Map<String,Object> getAuthenticationAttributes()
      Description copied from interface: AuthenticationUtils
      Retrieves the attributes on the current Authentication. This method is expected to return the attributes in a map which is generally achieved by a registered Converter bean.
      Specified by:
      getAuthenticationAttributes in interface AuthenticationUtils
      Returns:
      the attributes, if any, on the current Authentication
    • userIsAnonymous

      public boolean userIsAnonymous()
      Description copied from interface: AuthenticationUtils
      Checks if the authenticated user is anonymous.
      Specified by:
      userIsAnonymous in interface AuthenticationUtils
      Returns:
      true if the authenticated user is anonymous, otherwise false
    • getAuthenticatedFullName

      public String getAuthenticatedFullName()
      Description copied from interface: AuthenticationUtils
      Retrieves the full name of the authenticated user, if any.
      Specified by:
      getAuthenticatedFullName in interface AuthenticationUtils
      Returns:
      the full name of the authenticated user, if any
    • getAuthenticatedUsername

      @Nullable public String getAuthenticatedUsername()
      Description copied from interface: AuthenticationUtils
      Retrieves the username of the authenticated user, if any.
      Specified by:
      getAuthenticatedUsername in interface AuthenticationUtils
      Returns:
      the username of the authenticated user, if any
    • getAuthenticatedCustomerId

      public String getAuthenticatedCustomerId()
      Description copied from interface: AuthenticationUtils
      Retrieves the id of the authenticated customer, if any.
      Specified by:
      getAuthenticatedCustomerId in interface AuthenticationUtils
      Returns:
      the id of the authenticated customer, if any
    • getAuthenticatedAccountId

      public String getAuthenticatedAccountId()
      Description copied from interface: AuthenticationUtils
      Retrieves the account id found on the authentication of the current security context.
      Specified by:
      getAuthenticatedAccountId in interface AuthenticationUtils
      Returns:
      the account id found on the authentication of the current security context
    • getAuthenticatedParentAccountIds

      public List<String> getAuthenticatedParentAccountIds()
      Description copied from interface: AuthenticationUtils
      Retrieves a list of all parent account ids of the AuthenticationUtils.getAuthenticatedAccountId().

      The returned list does not include the account id found on the authentication of the current security context.

      Specified by:
      getAuthenticatedParentAccountIds in interface AuthenticationUtils
      Returns:
      list of all parent account ids of the AuthenticationUtils.getAuthenticatedAccountId()
    • getAuthenticatedCustomerSegmentIds

      public List<String> getAuthenticatedCustomerSegmentIds()
      Description copied from interface: AuthenticationUtils
      Retrieves the customer segment ids found on the authentication of the current security context.
      Specified by:
      getAuthenticatedCustomerSegmentIds in interface AuthenticationUtils
      Returns:
      list of customer segment ids found on the authentication of the current security context
    • userIsCSR

      public boolean userIsCSR()
      Description copied from interface: AuthenticationUtils
      Checks if the authenticated user is CSR.
      Specified by:
      userIsCSR in interface AuthenticationUtils
      Returns:
      true if the authenticated user is CSR, otherwise false
    • userIsCSRActingAsSelf

      public boolean userIsCSRActingAsSelf()
      Description copied from interface: AuthenticationUtils
      Checks 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:
      userIsCSRActingAsSelf in interface AuthenticationUtils
      Returns:
      true if the authenticated user is CSR, otherwise false
    • userIsCSRAnonymous

      public boolean userIsCSRAnonymous()
      Description copied from interface: AuthenticationUtils
      Checks if the authenticated user is CSR anonymous.
      Specified by:
      userIsCSRAnonymous in interface AuthenticationUtils
      Returns:
      true if the authenticated user is CSR anonymous, otherwise false
    • getAuthenticatedCsrUserId

      public String getAuthenticatedCsrUserId()
      Description copied from interface: AuthenticationUtils
      Retrieves the id of the CSR user, if any.
      Specified by:
      getAuthenticatedCsrUserId in interface AuthenticationUtils
      Returns:
      the id of the CSR user, if any
    • getAuthenticatedCsrUsername

      public String getAuthenticatedCsrUsername()
      Description copied from interface: AuthenticationUtils
      Retrieves the username of the CSR user, if any.
      Specified by:
      getAuthenticatedCsrUsername in interface AuthenticationUtils
      Returns:
      the username of the CSR user, if any
    • userIsInAdminContext

      public boolean userIsInAdminContext()
      Description copied from interface: AuthenticationUtils
      Whether or not the current user is in an admin context.
      Specified by:
      userIsInAdminContext in interface AuthenticationUtils
      Returns:
      true if the user is in an admin context
    • isAdminScopedServiceClient

      protected boolean isAdminScopedServiceClient(Map<String,Object> authenticationDetails)