mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
Polish getRemoteUser
- Corrected instanceof check Issue gh-3357
This commit is contained in:
parent
9c373ef4f8
commit
f614a8230c
@ -107,8 +107,8 @@ public class SecurityContextHolderAwareRequestWrapper extends HttpServletRequest
|
|||||||
if (auth.getPrincipal() instanceof UserDetails) {
|
if (auth.getPrincipal() instanceof UserDetails) {
|
||||||
return ((UserDetails) auth.getPrincipal()).getUsername();
|
return ((UserDetails) auth.getPrincipal()).getUsername();
|
||||||
}
|
}
|
||||||
if (auth.getPrincipal() instanceof AbstractAuthenticationToken) {
|
if (auth instanceof AbstractAuthenticationToken) {
|
||||||
return ((AbstractAuthenticationToken) auth.getPrincipal()).getName();
|
return auth.getName();
|
||||||
}
|
}
|
||||||
return auth.getPrincipal().toString();
|
return auth.getPrincipal().toString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user