Class ClientAuthentication
java.lang.Object
io.micronaut.security.authentication.ClientAuthentication
- All Implemented Interfaces:
Authentication
,Serializable
,Principal
An implementation of the Authentication interface intended to be used
by clients that deserialize token information into an authentication.
- Since:
- 3.0.0
- Author:
- James Kleeh
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIn order to correctly implement theSerializable
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.getName()
@NonNull Collection<String>
getRoles()
This implementation relies on a key being stored in the claims called "rolesKey" that stores the key where the roles are stored.
-
Constructor Details
-
ClientAuthentication
- Parameters:
name
- The name of the authenticationattributes
- The attributes for the authentication
-
-
Method Details
-
getName
-
getAttributes
Description copied from interface:Authentication
In order to correctly implement theSerializable
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 implementSerializable
.- Specified by:
getAttributes
in interfaceAuthentication
- Returns:
- Any additional attributes in the authentication
-
getRoles
This implementation relies on a key being stored in the claims called "rolesKey" that stores the key where the roles are stored. This claim is provided by the claims set generator in the jwt module.- Specified by:
getRoles
in interfaceAuthentication
- Returns:
- Any roles found in the attributes
-