Skip to content

Support Generic OIDC profiles from verified id_token claims #178

Description

@salasebas

Context

The Generic OAuth callback no longer accepts profile claims from id_token without verification. That closes the unsafe path where a token response or custom get_token hook could provide arbitrary sub/email claims and have them flow into account creation/linking.

Better Auth upstream 1.6.9 still allows genericOAuth to decode tokens.idToken as a profile source before userinfo. That appears to be a convenience/parity behavior, not a safe OIDC verification boundary.

Recommendation

Add explicit Generic OIDC support only if RustAuth can verify the id_token before using its claims as profile data.

The feature should require a deliberate OIDC configuration path, for example:

  • discovery or explicit JWKS endpoint
  • issuer validation
  • audience/client_id validation
  • expiration/not-before validation
  • nonce validation when the flow issues a nonce
  • algorithm/key validation with fail-closed errors

Non-goals

  • Do not re-enable decode-only id_token profile extraction.
  • Do not treat upstream's current decode behavior as sufficient validation.

Acceptance criteria

  • A generic provider can opt into verified id_token profile extraction.
  • Forged or unsigned id_token values are rejected.
  • Wrong issuer/audience/nonce tokens are rejected.
  • Existing userinfo_url and custom get_user_info behavior remains supported.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions