[PR #375] [MERGED] Add external browser support for OAuth2 authorization #297

Closed
opened 2026-03-22 21:14:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/375
Author: @gschier
Created: 1/29/2026
Status: Merged
Merged: 1/30/2026
Merged by: @gschier

Base: mainHead: omnara/caption-footsie


📝 Commits (10+)

  • 5c7751c Add external browser support for OAuth2 authorization
  • 092eeab Fix external browser callback: use local server URI and singleton pattern
  • 0c6b1f4 Cleaner page
  • 1fad6c9 Tweaks
  • 1904e1a Refinements
  • 85c6ab3 Move
  • 176766a Handle URL fragments in local callback server for implicit grant flow
  • 0d8f4e7 Extract shared getRedirectUrlViaExternalBrowser helper to reduce duplication
  • c7f63f9 Review feedback: inline callback page states, copy-from-ancestor with confirm, hasVisibleInputs helper
  • 27e84d6 Fix extractCode redirect URI mismatch for hosted callback type

📊 Changes

10 files changed (+832 additions, -162 deletions)

View changed files

📝 package-lock.json (+36 -36)
📝 package.json (+1 -1)
plugins/auth-oauth2/src/callbackServer.ts (+335 -0)
📝 plugins/auth-oauth2/src/grants/authorizationCode.ts (+68 -23)
📝 plugins/auth-oauth2/src/grants/implicit.ts (+104 -7)
📝 plugins/auth-oauth2/src/index.ts (+167 -49)
📝 src-web/components/DynamicForm.tsx (+15 -1)
📝 src-web/components/HttpAuthenticationEditor.tsx (+7 -4)
📝 src-web/components/core/Icon.tsx (+4 -0)
📝 src-web/hooks/useAuthTab.tsx (+95 -41)

📄 Description

OAuth2 authorization (authorization code and implicit grants) can now be completed in an external browser instead of the embedded webview. This is useful when OAuth providers block embedded browsers or when you need access to existing browser sessions (e.g., already logged in).

CleanShot 2026-01-30 at 10 01 22

Enable the "Use External Browser" checkbox in the OAuth2 settings to open the authorization URL in your default browser. Two callback modes are available:

  • Hosted Redirect (default) → Uses a Yaak-hosted endpoint (oauth.yaak.app) as an intermediary that forwards the redirect to Yaak
  • Localhost → Starts a local callback server on a configurable port (default 8765) for direct callback

A computed Redirect URI is displayed in the form so you know exactly which URI to register with your OAuth provider. A 5-minute timeout automatically cleans up the callback server if no response is received.

Other Changes

  • Fix implicit grant not respecting the Response Type dropdown (was always sending token)
  • Add "Copy from Folder/Workspace" action to copy authentication config from an ancestor, with confirmation dialog
  • Hide empty form containers (accordion, h_stack, banner) when all child inputs are hidden

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/375 **Author:** [@gschier](https://github.com/gschier) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `omnara/caption-footsie` --- ### 📝 Commits (10+) - [`5c7751c`](https://github.com/mountain-loop/yaak/commit/5c7751c8b2c0474ae89a4b5265daa004f10b8ea4) Add external browser support for OAuth2 authorization - [`092eeab`](https://github.com/mountain-loop/yaak/commit/092eeab01c3e04ef5375349da245ebfd8a45020c) Fix external browser callback: use local server URI and singleton pattern - [`0c6b1f4`](https://github.com/mountain-loop/yaak/commit/0c6b1f44656c6f8972fc77ba84e2f8698e3e4875) Cleaner page - [`1fad6c9`](https://github.com/mountain-loop/yaak/commit/1fad6c93068c93f234ee3ceda0f6f2481bcc8685) Tweaks - [`1904e1a`](https://github.com/mountain-loop/yaak/commit/1904e1a9196cc8efb8c8f3a8a3fe9b6f341476e1) Refinements - [`85c6ab3`](https://github.com/mountain-loop/yaak/commit/85c6ab31a8ec3c4f67d6ac5f2d6a0ee7fbb1f2eb) Move - [`176766a`](https://github.com/mountain-loop/yaak/commit/176766a64785291a97564235db1aba156e049b82) Handle URL fragments in local callback server for implicit grant flow - [`0d8f4e7`](https://github.com/mountain-loop/yaak/commit/0d8f4e7143b438046d4f7533ffaa549e7dca4dbc) Extract shared getRedirectUrlViaExternalBrowser helper to reduce duplication - [`c7f63f9`](https://github.com/mountain-loop/yaak/commit/c7f63f9cb8a7a9bb93f61a4ff88e329cc5caf31a) Review feedback: inline callback page states, copy-from-ancestor with confirm, hasVisibleInputs helper - [`27e84d6`](https://github.com/mountain-loop/yaak/commit/27e84d61e4931252aea31596df77a15512861193) Fix extractCode redirect URI mismatch for hosted callback type ### 📊 Changes **10 files changed** (+832 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+36 -36) 📝 `package.json` (+1 -1) ➕ `plugins/auth-oauth2/src/callbackServer.ts` (+335 -0) 📝 `plugins/auth-oauth2/src/grants/authorizationCode.ts` (+68 -23) 📝 `plugins/auth-oauth2/src/grants/implicit.ts` (+104 -7) 📝 `plugins/auth-oauth2/src/index.ts` (+167 -49) 📝 `src-web/components/DynamicForm.tsx` (+15 -1) 📝 `src-web/components/HttpAuthenticationEditor.tsx` (+7 -4) 📝 `src-web/components/core/Icon.tsx` (+4 -0) 📝 `src-web/hooks/useAuthTab.tsx` (+95 -41) </details> ### 📄 Description OAuth2 authorization (authorization code and implicit grants) can now be completed in an external browser instead of the embedded webview. This is useful when OAuth providers block embedded browsers or when you need access to existing browser sessions (e.g., already logged in). <img width="1260" height="399" alt="CleanShot 2026-01-30 at 10 01 22" src="https://github.com/user-attachments/assets/c96e6445-49eb-4922-8ef1-488e4e5edc10" /> Enable the **"Use External Browser"** checkbox in the OAuth2 settings to open the authorization URL in your default browser. Two callback modes are available: - **Hosted Redirect** (default) → Uses a Yaak-hosted endpoint (`oauth.yaak.app`) as an intermediary that forwards the redirect to Yaak - **Localhost** → Starts a local callback server on a configurable port (default 8765) for direct callback A computed **Redirect URI** is displayed in the form so you know exactly which URI to register with your OAuth provider. A 5-minute timeout automatically cleans up the callback server if no response is received. ### Other Changes - Fix implicit grant not respecting the Response Type dropdown (was always sending `token`) - Add **"Copy from Folder/Workspace"** action to copy authentication config from an ancestor, with confirmation dialog - Hide empty form containers (accordion, h_stack, banner) when all child inputs are hidden --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 21:14:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/yaak#297