Skip to content

fix(oidc): raise the 3500ms HTTP timeout that was killing Google sign-in - #323

Merged
izzywdev merged 1 commit into
masterfrom
claude/fix-oidc-timeout
Jul 20, 2026
Merged

fix(oidc): raise the 3500ms HTTP timeout that was killing Google sign-in#323
izzywdev merged 1 commit into
masterfrom
claude/fix-oidc-timeout

Conversation

@izzywdev

Copy link
Copy Markdown
Owner

The final link in the prod sign-in outage.

With the security service pinned to 1 replica (f6faf4de), the PKCE state is now found correctly — the callback logs hasCode: true, hasState: true. The only remaining failure is the code→token grant:

RPError: outgoing request timed out after 3500ms
  at Client.grant (openid-client/lib/client.js:1370)
  at OIDCService.handleCallback (oidc.js:109)

3500ms is openid-client's default, and it is below Authentik's real p99. The IdP averages ~1.3s per request with multi-second spikes, and the grant is several round-trips. So Google auth completed, the callback arrived with a valid code and state, and the exchange timed out — surfacing to the user as the opaque ?error=authentication_failed.

Fix

custom.setHttpOptionsDefaults({ timeout }) so it covers discovery, the token grant, userinfo and jwks — not just the one call that happened to fail first. Default 15000ms, overridable via OIDC_HTTP_TIMEOUT_MS so it can be tuned per environment without a rebuild.

Deploy caveat (important)

This is a code change, so it needs an image build. The release pipeline's deploy-application job is currently skipped (gated behind a failing AWS Terraform job that reads a non-existent ELB/ASG), so merging alone will not ship it — the securityService.image.tag in values-prod.yaml will need a manual bump, exactly as the frontend did in 6ec957ce.

Refs #294

🤖 Generated with Claude Code

The final link in the prod sign-in outage. With the security service pinned to 1
replica the PKCE state is now found correctly (callback logs 'hasCode: true,
hasState: true'), and the ONLY remaining failure is the code->token grant:

  RPError: outgoing request timed out after 3500ms
    at Client.grant (openid-client/lib/client.js:1370)
    at OIDCService.handleCallback (oidc.js:109)

3500ms is openid-client's default, and it is below Authentik's real p99 — the IdP
averages ~1.3s per request with multi-second spikes, and the grant is several
round-trips. So Google auth completed, the callback arrived with a valid code and
state, and the exchange then timed out — surfacing to the user as the opaque
?error=authentication_failed.

Set the timeout via custom.setHttpOptionsDefaults so it covers discovery, the
token grant, userinfo AND jwks — not just the one call that happened to fail
first. Default 15000ms, overridable with OIDC_HTTP_TIMEOUT_MS so it can be tuned
per environment without a rebuild.

Note this is a code change, so it needs an image build; the release pipeline's
deploy-application job is currently skipped (gated behind a failing AWS Terraform
job), so the securityService image tag will need a manual bump in values-prod to
actually reach prod.

Refs #294

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session-Id: f636c22e-1cd7-401e-8843-97e3e3a4ba01
@izzywdev izzywdev added the auto-merge Enable squash auto-merge once CI passes label Jul 20, 2026
@github-actions
github-actions Bot enabled auto-merge (squash) July 20, 2026 21:06
@izzywdev
izzywdev merged commit 0368764 into master Jul 20, 2026
49 of 50 checks passed
@izzywdev
izzywdev deleted the claude/fix-oidc-timeout branch July 20, 2026 21:19
izzywdev added a commit that referenced this pull request Jul 20, 2026
release.yml built the image but deploy-application is skipped (gated behind the
failing AWS Terraform job), so bump the tag here for Argo — same manual step the
frontend needed in 6ec957c. This ships the openid-client timeout fix that was the
last failure in the sign-in chain (code->token grant dying at the 3500ms default).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session-Id: f636c22e-1cd7-401e-8843-97e3e3a4ba01
@izzywdev
izzywdev restored the claude/fix-oidc-timeout branch July 27, 2026 11:43
@izzywdev
izzywdev deleted the claude/fix-oidc-timeout branch July 27, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enable squash auto-merge once CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant