public class ServerAuthentication extends java.lang.Object implements Authentication
Authentication
interfaced intended to
be used on the server side to create authentication objects from
user data found through any means.Constructor and Description |
---|
ServerAuthentication(java.lang.String name,
java.util.Collection<java.lang.String> roles,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Modifier and Type | Method and Description |
---|---|
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. |
java.lang.String |
getName() |
java.util.Collection<java.lang.String> |
getRoles() |
java.util.Map<java.lang.String,java.lang.Object> |
toJson() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, build, build, build
public ServerAuthentication(@NonNull java.lang.String name, @Nullable java.util.Collection<java.lang.String> roles, @Nullable java.util.Map<java.lang.String,java.lang.Object> attributes)
name
- The name of this principal nameroles
- Roles of the authenticated userattributes
- Attributes of the authenticated userpublic java.lang.String getName()
getName
in interface java.security.Principal
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Authentication
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
.getAttributes
in interface Authentication
@NonNull public java.util.Collection<java.lang.String> getRoles()
getRoles
in interface Authentication
public java.util.Map<java.lang.String,java.lang.Object> toJson()