Skip to content

OIDC Login Fails with Zitadel – Invalid Audience #965

@shanil-sasikumar

Description

@shanil-sasikumar

When integrating SQLPage with a self-hosted Zitadel instance using OIDC, the login screen appears correctly and authentication completes successfully. However, after login, the SQLPage server terminal logs the following error, and the application does not proceed:

ERROR sqlpage::webserver::oidc] Failed to process OIDC callback with params code=zxEH4-2j8tEq6Zkp-pQ9gxMK3MIy-Id9VzTd80Uu8Ha--g&state=nnve1VTxumBj2-pFY9gFdQ: Invalid audiences: `329836626744180738` is not a trusted audience
[2025-07-22T06:36:31.502Z INFO  actix_web::middleware::logger] 127.0.0.1 "GET /sqlpage/oidc_callback?code=...&state=... HTTP/1.1" 307 14 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/138.0.0.0 Safari/537.36" 0.457895

Details

  • OIDC Provider: Zitadel (self-hosted)
  • Discovery URL: {oidc_issuer_url}/.well-known/openid-configuration
  • OIDC Docs: Zitadel OIDC Integration Guide
  • SQLPage Config:
{
  "oidc_issuer_url": "<zitadel-self-hosted-url>",
  "oidc_client_id": "<client-id>",
  "oidc_client_secret": "<client-secret>",
  "host": "localhost:8080"
}
  • Redirect URI registered in Zitadel: http://localhost:8080/sqlpage/oidc_callback

Observation

After login, Zitadel issues a code, but SQLPage fails to validate the token with the error that the audience is not trusted.

Suggestion

It seems SQLPage may not recognize Zitadel as a valid OIDC provider or does not extract and validate the aud claim as expected for Zitadel-issued tokens. Guidance on expected audience format or a compatibility fix would help support Zitadel out-of-the-box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions