Skip to content

Conversation

@kylecarbs
Copy link
Member

Summary

Add support for any OpenID Connect provider (Okta, Auth0, Keycloak, Azure AD, etc.) similar to how Coder handles OIDC.

Changes

  • Add OIDC bindings to Bindings interface (OIDC_ISSUER_URL, OIDC_CLIENT_ID, etc.)
  • Extend provider type in schema to include 'oidc'
  • Implement OIDC discovery with caching (.well-known/openid-configuration)
  • Add initiateOIDCFlow() and handleOIDCCallback() functions
  • Add configurable claim mapping for email/username extraction
  • Add routes: GET /signin/oidc and GET /callback/oidc
  • Update /providers endpoint to conditionally include OIDC when configured
  • Wire up OIDC env vars in packages/server for self-hosted mode
  • Add 14 comprehensive tests for OIDC functionality

Configuration

Variable Required Description
OIDC_ISSUER_URL Yes OIDC provider's issuer URL
OIDC_CLIENT_ID Yes OAuth client ID
OIDC_CLIENT_SECRET Yes OAuth client secret
OIDC_SCOPES No Scopes (default: openid profile email)
OIDC_EMAIL_FIELD No Claim for email (default: email)
OIDC_USERNAME_FIELD No Claim for username (default: preferred_username)
OIDC_IGNORE_EMAIL_VERIFIED No Skip email verification check
OIDC_AUTH_URL_PARAMS No Extra auth URL params (JSON)
OIDC_SIGN_IN_TEXT No Custom button text
OIDC_ICON_URL No Custom button icon

Callback URL

https://<blink-domain>/api/auth/callback/oidc

Testing

Added 14 tests covering:

  • Provider listing (with/without OIDC, customization)
  • Sign-in flow (redirect, custom scopes, extra params, not configured)
  • Callback flow (missing code, invalid state, user creation, custom email field, email verification, existing user)

All new OIDC tests pass locally.

Add support for any OpenID Connect provider (Okta, Auth0, Keycloak, Azure AD, etc.)
similar to how Coder handles OIDC.

Changes:
- Add OIDC bindings to Bindings interface (OIDC_ISSUER_URL, OIDC_CLIENT_ID, etc.)
- Extend provider type in schema to include 'oidc'
- Implement OIDC discovery with caching (.well-known/openid-configuration)
- Add initiateOIDCFlow() and handleOIDCCallback() functions
- Add configurable claim mapping for email/username extraction
- Add routes: GET /signin/oidc and GET /callback/oidc
- Update /providers endpoint to conditionally include OIDC when configured
- Wire up OIDC env vars in packages/server for self-hosted mode
- Add 14 comprehensive tests for OIDC functionality

Configuration:
  OIDC_ISSUER_URL - OIDC provider's issuer URL (required)
  OIDC_CLIENT_ID - OAuth client ID (required)
  OIDC_CLIENT_SECRET - OAuth client secret (required)
  OIDC_SCOPES - Custom scopes (default: 'openid profile email')
  OIDC_EMAIL_FIELD - Claim for email (default: 'email')
  OIDC_USERNAME_FIELD - Claim for username (default: 'preferred_username')
  OIDC_AUTH_URL_PARAMS - Extra auth URL params as JSON
  OIDC_IGNORE_EMAIL_VERIFIED - Skip email verification check
  OIDC_SIGN_IN_TEXT - Custom button text
  OIDC_ICON_URL - Custom button icon

Callback URL: https://<domain>/api/auth/callback/oidc
@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
blink Ready Ready Preview, Comment Jan 26, 2026 3:07pm

Request Review

- Dynamically fetch OIDC provider from /api/auth/providers
- Show OIDC sign-in button when provider is configured
- Support custom button text and icon from OIDC_SIGN_IN_TEXT/OIDC_ICON_URL
- Add error messages for OIDC-specific error codes
- Track 'oidc' as last login provider
…fallback

- Add OIDC_AUTH_ENDPOINT, OIDC_TOKEN_ENDPOINT, OIDC_USERINFO_ENDPOINT env vars
- These override auto-discovery when set, useful for OAuth2 servers without OIDC
- Add fallback to /.well-known/oauth-authorization-server (RFC 8414)
- Supports Coder and other OAuth2-only providers
Coder and other OAuth2 providers return 'id' instead of OIDC's 'sub' claim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant