[GH-ISSUE #1189] Oauth auto login #779

Closed
opened 2026-03-02 11:52:41 +03:00 by kerem · 4 comments
Owner

Originally created by @dregini on GitHub (Apr 2, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1189

Describe the feature you'd like

Automatically Redirect to the OAuth Provider when both DISABLE_SIGNUPS and DISABLE_PASSWORD_AUTH are enabled,
if i have a Oauth Provider configured.

The login flow should start automatically redirecting to the identity provider instead of showing a landing page with the 2 phrases "Password authentication is currently disabled." and "Signups are currently disabled.".

as an alternative implement an additional variable (eg: OAUTH_AUTO_REDIRECT) to skip the landing page and start the login flow redirecting to the Identity provider

Describe the benefits this would bring to existing Hoarder users

It removes unnecessary user friction by skipping a useless landing page.
Improves user experience for apps that rely only on external authentication.

Can the goal of this request already be achieved via other means?

No

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

Additional context

No response

Originally created by @dregini on GitHub (Apr 2, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1189 ### Describe the feature you'd like Automatically Redirect to the OAuth Provider when both DISABLE_SIGNUPS and DISABLE_PASSWORD_AUTH are enabled, if i have a Oauth Provider configured. The login flow should start automatically redirecting to the identity provider instead of showing a landing page with the 2 phrases "Password authentication is currently disabled." and "Signups are currently disabled.". as an alternative implement an additional variable (eg: OAUTH_AUTO_REDIRECT) to skip the landing page and start the login flow redirecting to the Identity provider ### Describe the benefits this would bring to existing Hoarder users It removes unnecessary user friction by skipping a useless landing page. Improves user experience for apps that rely only on external authentication. ### Can the goal of this request already be achieved via other means? No ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundamental request ### Additional context _No response_
Author
Owner

@Eragos commented on GitHub (Apr 20, 2025):

+1 :)

<!-- gh-comment-id:2817277407 --> @Eragos commented on GitHub (Apr 20, 2025): +1 :)
Author
Owner

@SandraCHC commented on GitHub (Sep 23, 2025):

+1 :)
Maybe also possible to hide the login form

<!-- gh-comment-id:3324840357 --> @SandraCHC commented on GitHub (Sep 23, 2025): +1 :) Maybe also possible to hide the login form
Author
Owner

@MohamedBassem commented on GitHub (Feb 11, 2026):

@claude implement this and gate it with a client setting

<!-- gh-comment-id:3885383115 --> @MohamedBassem commented on GitHub (Feb 11, 2026): @claude implement this and gate it with a client setting
Author
Owner

@claude[bot] commented on GitHub (Feb 11, 2026):

Claude finished @MohamedBassem's task in 4m 1s —— View jobclaude/issue-1189-20260211-1601Create PR ➔


Implementation Complete

I've successfully implemented the OAuth auto-redirect feature as requested.

Todo List

  • Gather context - understand authentication flow and client settings
  • Add new client setting for OAuth auto redirect
  • Implement auto-redirect logic in signin page
  • Add documentation for new environment variable
  • Commit and push changes
  • Provide PR link

Changes Made

Added OAUTH_AUTO_REDIRECT environment variable:

  • When enabled along with DISABLE_PASSWORD_AUTH, users are automatically redirected to the OAuth provider
  • Eliminates the unnecessary landing page showing "Password authentication is currently disabled"
  • Improves user experience for deployments relying solely on external authentication

Files Changed:

  1. packages/shared/config.ts - Added OAUTH_AUTO_REDIRECT config and exposed it in client config
  2. apps/web/lib/clientConfig.tsx - Updated client config context with new field
  3. apps/web/components/signin/OAuthAutoRedirect.tsx - New component handling auto-redirect logic
  4. apps/web/components/signin/SignInForm.tsx - Integrated auto-redirect component
  5. docs/docs/03-configuration/01-environment-variables.md - Added documentation

How It Works

The auto-redirect triggers when:

  1. OAUTH_AUTO_REDIRECT=true is set
  2. DISABLE_PASSWORD_AUTH=true is set
  3. An OAuth provider is configured (via OAUTH_WELLKNOWN_URL)

When all conditions are met, users are immediately redirected to the OAuth provider's login page, bypassing the Karakeep login page entirely.

Usage

To enable this feature, set the following environment variables:

OAUTH_AUTO_REDIRECT=true
DISABLE_PASSWORD_AUTH=true
OAUTH_WELLKNOWN_URL=<your-provider-url>
OAUTH_CLIENT_ID=<your-client-id>
OAUTH_CLIENT_SECRET=<your-client-secret>

--- | Branch: claude/issue-1189-20260211-1601

<!-- gh-comment-id:3885384553 --> @claude[bot] commented on GitHub (Feb 11, 2026): **Claude finished @MohamedBassem's task in 4m 1s** —— [View job](https://github.com/karakeep-app/karakeep/actions/runs/21912525921) • [`claude/issue-1189-20260211-1601`](https://github.com/karakeep-app/karakeep/tree/claude/issue-1189-20260211-1601) • [Create PR ➔](https://github.com/karakeep-app/karakeep/compare/main...claude/issue-1189-20260211-1601?quick_pull=1&title=feat%3A%20add%20OAuth%20auto-redirect%20functionality&body=Add%20OAUTH_AUTO_REDIRECT%20environment%20variable%20to%20automatically%20redirect%20users%20to%20the%20OAuth%20provider%20when%20both%20password%20authentication%20is%20disabled%20and%20an%20OAuth%20provider%20is%20configured.%0A%0AChanges%3A%0A-%20Add%20OAUTH_AUTO_REDIRECT%20config%20in%20packages/shared/config.ts%0A-%20Create%20OAuthAutoRedirect%20component%20for%20client-side%20redirect%20logic%0A-%20Update%20SignInForm%20to%20include%20auto-redirect%20functionality%0A-%20Add%20oauthAutoRedirect%20to%20client%20config%20context%0A-%20Document%20new%20environment%20variable%20in%20configuration%20docs%0A%0AThis%20improves%20user%20experience%20by%20eliminating%20unnecessary%20clicks%20when%20OAuth%20is%20the%20only%20available%20authentication%20method.%0A%0AFixes%20%231189%0A%0AGenerated%20with%20%5BClaude%20Code%5D%28https%3A//claude.ai/code%29) --- ### Implementation Complete I've successfully implemented the OAuth auto-redirect feature as requested. ### Todo List - [x] Gather context - understand authentication flow and client settings - [x] Add new client setting for OAuth auto redirect - [x] Implement auto-redirect logic in signin page - [x] Add documentation for new environment variable - [x] Commit and push changes - [x] Provide PR link ### Changes Made **Added `OAUTH_AUTO_REDIRECT` environment variable:** - When enabled along with `DISABLE_PASSWORD_AUTH`, users are automatically redirected to the OAuth provider - Eliminates the unnecessary landing page showing "Password authentication is currently disabled" - Improves user experience for deployments relying solely on external authentication **Files Changed:** 1. `packages/shared/config.ts` - Added `OAUTH_AUTO_REDIRECT` config and exposed it in client config 2. `apps/web/lib/clientConfig.tsx` - Updated client config context with new field 3. `apps/web/components/signin/OAuthAutoRedirect.tsx` - New component handling auto-redirect logic 4. `apps/web/components/signin/SignInForm.tsx` - Integrated auto-redirect component 5. `docs/docs/03-configuration/01-environment-variables.md` - Added documentation ### How It Works The auto-redirect triggers when: 1. `OAUTH_AUTO_REDIRECT=true` is set 2. `DISABLE_PASSWORD_AUTH=true` is set 3. An OAuth provider is configured (via `OAUTH_WELLKNOWN_URL`) When all conditions are met, users are immediately redirected to the OAuth provider's login page, bypassing the Karakeep login page entirely. ### Usage To enable this feature, set the following environment variables: ``` OAUTH_AUTO_REDIRECT=true DISABLE_PASSWORD_AUTH=true OAUTH_WELLKNOWN_URL=<your-provider-url> OAUTH_CLIENT_ID=<your-client-id> OAUTH_CLIENT_SECRET=<your-client-secret> ``` --- | [Branch: claude/issue-1189-20260211-1601](https://github.com/karakeep-app/karakeep/tree/claude/issue-1189-20260211-1601)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#779
No description provided.