Class DefaultRolesFinder
java.lang.Object
io.micronaut.security.token.DefaultRolesFinder
- All Implemented Interfaces:
RolesFinder
Default implementation of
RolesFinder.
The implementation reads roles from the attribute configured by
TokenConfiguration.getRolesName(). If the value is a string and
TokenConfiguration.getRolesSeparator() is configured, the value is
split with that separator. Iterable values are converted to a list of strings.
- Since:
- 1.1.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRolesFinder(TokenConfiguration tokenConfiguration) Constructs a default roles finder. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RolesFinder
hasAnyRequiredRoles, hasAnyRequiredRoles
-
Constructor Details
-
DefaultRolesFinder
Constructs a default roles finder.- Parameters:
tokenConfiguration- General token configuration
-
-
Method Details
-
resolveRoles
Description copied from interface:RolesFinderResolves granted roles from the user's authentication attributes.Implementations should return an empty list when the attributes are
nullor no roles can be resolved.- Specified by:
resolveRolesin interfaceRolesFinder- Parameters:
attributes- The user's authentication attributes- Returns:
- The granted roles
-