Interface CrowdUserDetailsService

All Superinterfaces:
org.springframework.security.core.userdetails.UserDetailsService
All Known Implementing Classes:
CrowdUserDetailsServiceImpl

public interface CrowdUserDetailsService extends org.springframework.security.core.userdetails.UserDetailsService
Interface for retrieving users from Crowd.
Author:
Shihab Hamid
  • Method Details

    • loadUserByUsername

      CrowdUserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException, org.springframework.dao.DataAccessException
      Retrieves the user from Crowd by looking up the principal by username.
      Specified by:
      loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
      Parameters:
      username - username of the principal.
      Returns:
      CrowdUserDetails corresponding to the principal.
      Throws:
      org.springframework.security.userdetails.UsernameNotFoundException - thrown if a principal with the requested username cannot be found in Crowd.
      org.springframework.dao.DataAccessException - thrown if there was an underlying problem while communicating with the Crowd server.
      org.springframework.security.core.userdetails.UsernameNotFoundException
    • loadUserByToken

      CrowdUserDetails loadUserByToken(String token) throws CrowdSSOTokenInvalidException, org.springframework.dao.DataAccessException
      Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.
      Parameters:
      token - Crowd SSO token string.
      Returns:
      CrowdUserDetails corresponding to the principal.
      Throws:
      com.atlassian.crowd.integration.springframework.security.CrowdSSOTokenInvalidException - if the provided token is invalid.
      org.springframework.dao.DataAccessException - thrown if there was an underlying problem while communicating with the Crowd server.
      CrowdSSOTokenInvalidException
    • getAuthorityPrefix

      String getAuthorityPrefix()
      Return the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[] and no authorityMap is set.
      Returns:
      prefix.
    • setAuthorityPrefix

      void setAuthorityPrefix(String authorityPrefix)
      Set the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[] and no authorityMap is set, e.g. ROLE_crowd-administrators.
      Parameters:
      authorityPrefix - prefix to apply. The default is no prefix.
    • getGroupToAuthorityMappings

      Iterable<Map.Entry<String,String>> getGroupToAuthorityMappings()
      Return the group-to-authority mappings
      Returns:
      an iterable over mappings from group names (key) to authority names (value)
    • setGroupToAuthorityMappings

      void setGroupToAuthorityMappings(Iterable<Map.Entry<String,String>> groupToAuthorityMappings)
      Set the authority mappings. The default is no authority mappings, which implies that authorities are derived from group names, with an optional authorityPrefix. If not null, the mappings are used instead to transform group names into authority names regardless of the authorityPrefix.

      Versions of Crowd prior to 2.6 used to have a configurable authoritySuffix parameter which has been replaced by these mappings.

      Parameters:
      groupToAuthorityMappings - authority mappings. If absent, an authority prefix is used.
    • getAdminAuthority

      String getAdminAuthority()
      Return the name of the admin authority.
      Returns:
      name of the admin authority
    • setAdminAuthority

      void setAdminAuthority(String adminAuthority)
      Set the name of the admin authority.
      Parameters:
      adminAuthority - name of the admin authority. The default is ROLE_SYS_ADMIN.