Skip to content

[DOCS] Authentication: AUTH_OIDC_AUDIENCE, RFC 6750 challenges, and Entra, Google and Cognito examples #665

Closed

Description

@edenreich

Summary

inference-gateway/inference-gateway#646 changes the OIDC authentication surface and the authentication docs are behind it:

  • The Kubernetes example moved from examples/kubernetes/authentication to examples/kubernetes/auth-keycloak, and the docker-compose one from examples/docker-compose/authentication to examples/docker-compose/auth-keycloak. authentication.md still links to the old paths.
  • New AUTH_OIDC_AUDIENCE setting: a comma-separated list of accepted aud values (for example an API identifier). Empty means AUTH_OIDC_CLIENT_ID. AUTH_OIDC_ISSUER and AUTH_OIDC_CLIENT_ID no longer have demo Keycloak defaults; enabling auth without them fails at startup.
  • Tokens with no aud claim are accepted when their client_id claim matches a configured value (Amazon Cognito machine tokens).
  • Rejected requests now carry an RFC 6750 WWW-Authenticate: Bearer realm="inference-gateway" challenge, with error="invalid_token" when a token was presented but failed verification.
  • New examples for Microsoft Entra ID, Google Cloud service accounts and Amazon Cognito, each as docker-compose (examples/docker-compose/auth-entra, auth-gcp, auth-cognito) and Kubernetes (examples/kubernetes/auth-entra, auth-gcp, auth-cognito).

Affected pages: authentication.md, the configuration reference for AUTH_* variables.

Source: inference-gateway/inference-gateway#646

Acceptance Criteria

  • authentication.md links to examples/docker-compose/auth-keycloak and examples/kubernetes/auth-keycloak
  • AUTH_OIDC_AUDIENCE is documented with its default and the client_id fallback for aud-less tokens
  • The WWW-Authenticate challenge on 401 responses is documented
  • An identity provider table (Keycloak, Entra ID, Google, Cognito, Auth0, Okta) lists the issuer and audience to configure, mirroring the one in examples/docker-compose/auth-keycloak/README.md
  • The six new Entra, Google and Cognito examples are linked

Activity

  1. added
    documentation
    on Sep 11, 2026
  2. added theissue type on Sep 11, 2026
  3. moved this to Todo in 2026on Sep 11, 2026
  4. edenreich commented on Sep 11, 2026

    @edenreich
    ContributorAuthor

    @claude Can you document this? use /ponytail:ponytail?

  5. inference-gateway-maintainer commented on Sep 11, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 5m 35s —— View job • docs/issue-665-20260911-1743 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-665-20260911-1743?quick_pull=1&title=Issue%20%23665%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23665%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documenting the OIDC auth changes

    PR: #668

    What changed

    authentication.md

    • New Audience validation section: AUTH_OIDC_AUDIENCE as a comma-separated list, defaulting to AUTH_OIDC_CLIENT_ID, and the client_id fallback for tokens with no aud claim (Cognito machine tokens).
    • AUTH_OIDC_ISSUER / AUTH_OIDC_CLIENT_ID no longer have demo defaults and are required at startup; AUTH_OIDC_CLIENT_SECRET is not read by the gateway at all (it only verifies tokens), so the env-var table, the Kubernetes Secret example and the manual-setup steps were corrected.
    • New Rejected requests section: the RFC 6750 WWW-Authenticate: Bearer realm="inference-gateway" challenge, error="invalid_token" when a token was presented and failed, the case-insensitive scheme, and the public /health endpoint.
    • New Identity providers table (Keycloak, Entra ID, Google, Cognito, Auth0, Okta) with the issuer and audience to configure, mirroring examples/docker-compose/auth-keycloak/README.md.
    • New Runnable examples table linking all six new examples plus the renamed auth-keycloak pair; the stale examples/kubernetes/authentication path is gone.
    • Keycloak manual setup gains the audience-mapper step; the password grant flow is removed (RFC 9700 2.4), leaving client credentials.
    • Troubleshooting gains audience/issuer mismatch and startup-failure entries.

    configuration.md - OIDC table gains AUTH_OIDC_AUDIENCE, loses the demo defaults and AUTH_OIDC_CLIENT_SECRET (also from the example Secret and the complete .env).

    operator.md - one note: clientSecretRef still emits an env var the gateway ignores, and the CRD has no audience field yet (operator#216).

    Not done / follow-up

    inference-gateway/schemas openapi.yaml on main still carries the old AUTH_OIDC_* defaults and AUTH_OIDC_CLIENT_SECRET. The OIDC table in configuration.md is hand-maintained (outside the GENERATED:* markers), so task generate does not overwrite these edits - but the schema should catch up. Filed as inference-gateway/schemas#203.
    | Branch

  6. moved this from Todo to In progress in 2026on Sep 11, 2026
  7. moved this from In progress to QA in 2026on Sep 11, 2026
  8. moved this from QA to Done in 2026on Sep 11, 2026
  9. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions