The Gateway Controller REST API (the control-plane API used to manage gateway configuration) can be protected using either locally configured users (Basic Auth) or an external Identity Provider (JWT validation via JWKS). Authorization is role-based and enforced per API route.
You can enable one (or both) of the following:
- Basic Auth (local users): Define usernames/passwords and assign local roles.
- IDP/JWT (external users): Validate incoming JWTs using
jwks_urloptionallyissuer.
No Authentication (open access): If BOTH basic.enabled and idp.enabled are set to false, all requests to the gateway controller are allowed without authentication.
Gateway Controller routes are protected using local roles (for example admin, developer, consumer).
- If
roles_claimis NOT configured in the IDP/JWT setup, authorization is bypassed for the Gateway Controller REST API routes (i.e., no role checks are performed). - If
roles_claimIS configured, you must also configurerole_mapping. Without a mapping, the controller cannot translate IDP roles → local roles, and requests will be denied.
In the umbrella gateway config, these settings live under controller.auth. (If you run the controller standalone, the same structure applies under the controller's config root.)
controller:
auth:
basic:
enabled: true
users:
- username: "platform-admin"
password: "$bcrypt$..."
password_hashed: true
roles: ["admin"]
- username: "ops"
password: "ops"
password_hashed: false
roles: ["developer"]controller:
auth:
idp:
enabled: true
jwks_url: "https://idp.example.com/oauth2/jwks"
issuer: "https://idp.example.com/oauth2/token"
# Turn ON authorization by providing BOTH:
roles_claim: "groups" # e.g., "groups", "scope", "roles"
role_mapping:
admin: ["gateway-admins", "platform-admins"]
developer: ["api-developers", "ops"]
# Optional: give any authenticated user a baseline role
consumer: ["*"]role_mapping is defined as:
local_role -> [idp_role_value_1, idp_role_value_2, ...]
Notes:
- Specific mappings take precedence over wildcard matches.
- Wildcard (
"*") means: if a JWT role value does not match any specific mapping, it can still map to the local role that includes"*". - One JWT role can grant multiple local roles by listing it under multiple local roles.
- Wildcard mapping must be unique: Do not configure more than one local role with
"*"(for exampleadmin: ["*"]andconsumer: ["*"]). The Gateway Controller validates configuration and rejects multiple wildcard roles inrole_mapping.
role_mapping:
admin: ["platform-admins"]
developer: ["platform-admins", "api-developers"]In this example, a user in platform-admins becomes both admin and developer in the Gateway Controller.
- Requests are denied after enabling JWT auth: verify
jwks_urland (if set)issuermatch the token you're sending. - You enabled
roles_claimand suddenly everything is forbidden: addrole_mapping(mapping is mandatory whenroles_claimis provided). - Users authenticate but don't have expected access: confirm the token actually contains the configured
roles_claim, and that its values match what you listed inrole_mapping. - You want authN but not authZ: keep IDP enabled, but leave
roles_claimandrole_mappingunset to bypass authorization checks. - You want to disable auth entirely: set both
basic.enabledandidp.enabledtofalse.
Unit tests cover wildcard precedence, one-to-many role grants, and supported claim formats for roles_claim.