Annotation Interface ScopesAllowed


@Retention(RUNTIME) @Target(TYPE) public @interface ScopesAllowed
Restricts a handler to callers whose token carries the required OAuth2 scopes. Authentication is implicitly required.

Scopes are resolved from the configured claim paths in OidcConfig.scopeClaimPaths() (default: "scope,scp") and support both standard formats:

  • scope: space-separated string
  • scp: string list (or string)

 @Route(method = HttpMethod.GET, path = "/api/orders")
 @ScopesAllowed("orders:read")
 public class ListOrders extends JacksonHandler { ... }

 @Route(method = HttpMethod.POST, path = "/api/orders")
 @ScopesAllowed(value = {"orders:write", "payments:write"}, match = ScopesAllowed.Match.ANY)
 public class CreateOrder extends JacksonHandler { ... }
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Required scopes.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Matching mode for value().