Package jenkins.security
Class ImpersonatingUserDetailsService2
java.lang.Object
jenkins.security.ImpersonatingUserDetailsService2
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
public class ImpersonatingUserDetailsService2
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService
UserDetailsService
for those SecurityRealm
that doesn't allow query of other users.
When the backend responds with UserMayOrMayNotExistException2
, we try to replace that with
information stored in LastGrantedAuthoritiesProperty
.- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
ConstructorDescriptionImpersonatingUserDetailsService2
(org.springframework.security.core.userdetails.UserDetailsService base) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.core.userdetails.UserDetails
attemptToImpersonate
(String username, RuntimeException e) org.springframework.security.core.userdetails.UserDetails
loadUserByUsername
(String username)
-
Constructor Details
-
ImpersonatingUserDetailsService2
public ImpersonatingUserDetailsService2(org.springframework.security.core.userdetails.UserDetailsService base)
-
-
Method Details
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsername
in interfaceorg.springframework.security.core.userdetails.UserDetailsService
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
attemptToImpersonate
protected org.springframework.security.core.userdetails.UserDetails attemptToImpersonate(String username, RuntimeException e)
-