Remove AuthenticatedPrincipal from UserDetails
Issue gh-4877
This commit is contained in:
@@ -43,7 +43,7 @@ public class MapReactiveUserDetailsService implements ReactiveUserDetailsService
|
||||
|
||||
public MapReactiveUserDetailsService(Collection<UserDetails> users) {
|
||||
Assert.notEmpty(users, "users cannot be null or empty");
|
||||
this.users = users.stream().collect(Collectors.toConcurrentMap( u -> getKey(u.getName()), Function.identity()));
|
||||
this.users = users.stream().collect(Collectors.toConcurrentMap( u -> getKey(u.getUsername()), Function.identity()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.AuthenticatedPrincipal;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
@@ -42,7 +41,7 @@ import java.util.Collection;
|
||||
*
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public interface UserDetails extends AuthenticatedPrincipal, Serializable {
|
||||
public interface UserDetails extends Serializable {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
@@ -100,14 +99,4 @@ public interface UserDetails extends AuthenticatedPrincipal, Serializable {
|
||||
* @return <code>true</code> if the user is enabled, <code>false</code> otherwise
|
||||
*/
|
||||
boolean isEnabled();
|
||||
|
||||
/**
|
||||
* Returns the name of the user. Cannot return <code>null</code>.
|
||||
* The default implementation of this method returns {@link #getUsername()}.
|
||||
*
|
||||
* @return the name of the user (never <code>null</code>)
|
||||
*/
|
||||
default String getName() {
|
||||
return getUsername();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user