public class UserServiceImpl extends Object implements UserService
Constructor and Description |
---|
UserServiceImpl(ApplicationManager applicationManager,
ApplicationService applicationService,
CrowdUserDetailsService crowdUserDetailsService,
TokenAuthenticationManager tokenAuthenticationManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(String username,
String password)
Given a usernamen & password, this method checks, whether or not the provided user can
be authenticated
|
String |
getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
Returns the username of the currently logged in user or null if no user can be found.
|
String |
getRemoteUsername()
Returns the username of the currently logged in user or null if no user can be found.
|
boolean |
isSystemAdmin(String username)
Returns true or false depending on if a user has been granted the system admin permission within Crowd.
|
boolean |
isUserInGroup(String username,
String group)
Returns whether the user is in the specify group
|
Principal |
resolve(String username)
Returns the user that made this request or
null if this application does not have such a user. |
public UserServiceImpl(ApplicationManager applicationManager, ApplicationService applicationService, CrowdUserDetailsService crowdUserDetailsService, TokenAuthenticationManager tokenAuthenticationManager)
public String getRemoteUsername()
UserService
getRemoteUsername
in interface UserService
public String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
UserService
getAuthenticatedUsername
in interface UserService
request
- The request to retrieve the username frompublic boolean isUserInGroup(String username, String group)
UserService
isUserInGroup
in interface UserService
username
- The username to checkgroup
- The group to checkpublic boolean isSystemAdmin(String username) throws org.springframework.dao.DataAccessException
UserService
isSystemAdmin
in interface UserService
username
- The username of the user to checkorg.springframework.dao.DataAccessException
- if there was an error retrieving the usernamepublic boolean authenticate(String username, String password)
UserService
authenticate
in interface UserService
username
- Username of the userpassword
- Password of the userpublic Principal resolve(String username) throws org.springframework.dao.DataAccessException
UserService
null
if this application does not have such a user.resolve
in interface UserService
username
- Username of the user a consumer is making a request on behalf ofPrincipal
corresponding to the username, null
if the user does not existorg.springframework.dao.DataAccessException
- if there was an error retrieving the usernameCopyright © 2013 Atlassian. All Rights Reserved.