Class ClaimRoles

java.lang.Object
dev.relism.flash.ext.security.oidc.ClaimRoles
All Implemented Interfaces:
dev.relism.flash.ext.security.RoleResolver

public final class ClaimRoles extends Object implements dev.relism.flash.ext.security.RoleResolver
Roles read from the provider's token instead of the application's own data.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ClaimRoles
    at(String claimPath)
    Roles at a dot-separated claim path — realm_access.roles for Keycloak, groups for most others.
    boolean
    hasRole(dev.relism.flash.ext.security.SecurityIdentity identity, String role, dev.relism.flash.ext.security.Target on)
     
    of(dev.relism.flash.ext.security.Principal principal)
    The roles principal's token carries; none for a caller OIDC did not authenticate.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • at

      public static ClaimRoles at(String claimPath)
      Roles at a dot-separated claim path — realm_access.roles for Keycloak, groups for most others.
    • of

      public List<String> of(dev.relism.flash.ext.security.Principal principal)
      The roles principal's token carries; none for a caller OIDC did not authenticate.
    • hasRole

      public boolean hasRole(dev.relism.flash.ext.security.SecurityIdentity identity, String role, dev.relism.flash.ext.security.Target on)
      Specified by:
      hasRole in interface dev.relism.flash.ext.security.RoleResolver