com.atlassian.crowd.integration.springsecurity.user
Interface CrowdUserDetailsService

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

public interface CrowdUserDetailsService
extends org.springframework.security.userdetails.UserDetailsService

Interface for retrieving users from Crowd.

Author:
Shihab Hamid

Method Summary
 java.lang.String getAuthorityPrefix()
          Return the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[].
 java.lang.String getAuthoritySuffix()
          Return the authority suffix, e.g.
 CrowdUserDetails loadUserByToken(java.lang.String token)
          Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.
 CrowdUserDetails loadUserByUsername(java.lang.String username)
          Retrieves the user from Crowd by looking up the principal by username.
 void setAuthorityPrefix(java.lang.String authorityPrefix)
          Set the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[].
 void setAuthoritySuffix(java.lang.String authoritySuffix)
          Set the authority suffix e.g.
 

Method Detail

loadUserByUsername

CrowdUserDetails loadUserByUsername(java.lang.String username)
                                    throws org.springframework.security.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.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.

loadUserByToken

CrowdUserDetails loadUserByToken(java.lang.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

java.lang.String getAuthorityPrefix()
Return the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[].

Returns:
prefix.

setAuthorityPrefix

void setAuthorityPrefix(java.lang.String authorityPrefix)
Set the authority prefix applied to group names the principal is a member of when generating the GrantedAuthority[].

Parameters:
authorityPrefix - prefix to apply. The default is no prefix.

getAuthoritySuffix

java.lang.String getAuthoritySuffix()
Return the authority suffix, e.g. "ADMIN" Currently crowd does not support multiple ROLE types, so just one will be returned. If this value is not set, Authorities will be returned based on group name, e.g. ROLE_crowd-administrators.

Returns:
prefix.

setAuthoritySuffix

void setAuthoritySuffix(java.lang.String authoritySuffix)
Set the authority suffix e.g. "ADMIN" Currently crowd does not support multiple ROLE types, so just one will be returned. If this value is not set, Authorities will be returned based on group name, e.g. ROLE_crowd-administrators.

Parameters:
authoritySuffix - suffix to apply.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.