public interface Authentication
extends java.security.Principal, java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
static Authentication |
build(java.lang.String username)
Builds an
Authentication instance for the user. |
static Authentication |
build(java.lang.String username,
java.util.Collection<java.lang.String> roles)
Builds an
Authentication instance for the user. |
static Authentication |
build(java.lang.String username,
java.util.Collection<java.lang.String> roles,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Builds an
Authentication instance for the user. |
static Authentication |
build(java.lang.String username,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Builds an
Authentication instance for the user. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
In order to correctly implement the
Serializable specification, this map
should be Map<String, Serializable>, however that would place a burden on
those not requiring serialization, forcing their values to conform to that spec. |
default java.util.Collection<java.lang.String> |
getRoles() |
@NonNull java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Serializable specification, this map
should be Map<String, Serializable>, however that would place a burden on
those not requiring serialization, forcing their values to conform to that spec.
This is left intentionally as Object in order to meet both use cases and those
requiring serialization must ensure all values in the map implement Serializable.@NonNull default java.util.Collection<java.lang.String> getRoles()
@NonNull static Authentication build(@NonNull java.lang.String username)
Authentication instance for the user.username - User's nameAuthentication for the User@NonNull static Authentication build(@NonNull java.lang.String username, @NonNull java.util.Collection<java.lang.String> roles)
Authentication instance for the user.username - User's nameroles - User's rolesAuthentication for the User@NonNull static Authentication build(@NonNull java.lang.String username, @NonNull java.util.Map<java.lang.String,java.lang.Object> attributes)
Authentication instance for the user.username - User's nameattributes - User's attributesAuthentication for the User@NonNull static Authentication build(@NonNull java.lang.String username, @Nullable java.util.Collection<java.lang.String> roles, @Nullable java.util.Map<java.lang.String,java.lang.Object> attributes)
Authentication instance for the user.username - User's nameroles - User's rolesattributes - User's attributesAuthentication for the User