Interface RolesFinder

All Known Implementing Classes:
DefaultRolesFinder

@DefaultImplementation(DefaultRolesFinder.class) public interface RolesFinder
Retrieves roles from token claims.
Since:
1.1.0
Author:
Sergio del Amo
  • Method Details

    • hasAnyRequiredRoles

      default boolean hasAnyRequiredRoles(@NonNull @NonNull List<String> requiredRoles, @Nullable @Nullable Map<String,Object> attributes)
      Parameters:
      requiredRoles - The list of roles required to be authorized
      attributes - User's attributes
      Returns:
      true if any the roles specified in the attributes is in the required roles list.
    • hasAnyRequiredRoles

      default boolean hasAnyRequiredRoles(@NonNull @NonNull List<String> requiredRoles, @NonNull @NonNull Collection<String> grantedRoles)
      Parameters:
      requiredRoles - The list of roles required to be authorized
      grantedRoles - The list of roles granted to the user
      Returns:
      true if any of the granted roles is in the required roles list.
    • resolveRoles

      @NonNull @NonNull List<String> resolveRoles(@Nullable @Nullable Map<String,Object> attributes)
      Retrieves the list of roles from the User Attributes.
      Parameters:
      attributes - User's attributes
      Returns:
      The granted roles.