Class DefaultAuthenticationUtils
- java.lang.Object
-
- com.broadleafcommerce.resource.security.utils.service.DefaultAuthenticationUtils
-
- All Implemented Interfaces:
AuthenticationUtils
public class DefaultAuthenticationUtils extends Object implements AuthenticationUtils
-
-
Constructor Summary
Constructors Constructor Description DefaultAuthenticationUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAuthenticatedCsrUserId()Retrieves the id of the CSR user, if any.StringgetAuthenticatedCsrUsername()Retrieves the username of the CSR user, if any.StringgetAuthenticatedCustomerId()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.StringgetAuthenticatedFullName()Retrieves the full name of the authenticated user, if any.StringgetAuthenticatedUsername()Retrieves the username of the authenticated user, if any.Map<String,Object>getAuthenticationAttributes()Retrieves the attributes on the currentAuthentication.voidsetAttributesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.core.Authentication,Map<String,Object>> attributesConverter)booleanuserIsAnonymous()Checks if the authenticated user is anonymous.booleanuserIsCSR()Checks if the authenticated user is CSR.booleanuserIsCSRAnonymous()Checks if the authenticated user is CSR anonymous.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
getAuthentication
-
-
-
-
Method Detail
-
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: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
public String 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
@Nullable public String 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
public String 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
-
getAuthenticatedCustomerSegmentIds
public List<String> 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
-
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
public String 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
public String 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
-
-