Repository navigation
OAuth failure #303
Replies: 7 comments
|
Same error using pocket-id for auth. Like @aarononeal said, it looks like the OAuth redirect url isn't being handled. Edit: Just for extra context I experienced this on mac |
Environment
What happensI'm hitting the same issue with the desktop app + a remote Open WebUI instance configured with Google SSO. After completing the Google login (including 2FA), the desktop ends up on a Google 400. That's an error. The server cannot process the request What the logs show On the desktop side, mid-flow it explicitly hands the OAuth consent URL to the system browser: › Opening URL in browser: https://accounts.google.com/signin/oauth/legacy/consent?... On the Open WebUI server side, the callback then arrives without the session that was started inside the Electron webview, so authlib rejects it: WARNING | open_webui.utils.oauth:handle_callback - OAuth callback error during authorize_access_token for provider google: OAuth callback failed: mismatching_state: CSRF Warning! State not equal in request and response. The renderer also reports: "No token found in localStorage, user-join event not emitted" Why it failsThe OAuth state / session cookie is set on the request that the Electron webview makes to /oauth/google/login. When the consent URL is opened in the system browser instead of being completed inside the webview, the final redirect to Confirmed working
So the server config and Google OAuth client are healthy; the breakage is specifically the desktop pushing the OAuth flow out to the system browser, which loses the session continuity required for the state check. Happy to provide more logs if useful
|
|
The "open URL in browser" implementation currently has an issue: it should only function when the URL is being processed by an OpenWebUI instance. A possible solution would be to add a query parameter to the web page to determine if the OpenWebUI instance has been successfully loaded. |
|
I have just installed the OpenWeb UI desktop software on a new machine, and encountered this error. I have Cloudflare Access handling SSO, and Google and GitHub being the two identity providers set up in Access. This all works fine in many other scenarios. On my previous device, shortly after OWU desktop was launched this flow worked fine - the SSO process happened entirely within the OWU desktop software, it passed the CF auth headers to OWU successfully, and log in works correctly. It was only when I installed it on a second device today that I encountered this error. So this seems to have been a recently-introduced bug. |
|
+1 for the issue with JumpCloud SSO. Opening SSO in external browser window causes authentication success not to make it back to desktop app. |
|
Just confirmed this is still happening on Open WebUI Desktop 0.0.20 on an Apple Silicon Mac, connecting to Open WebUI 0.11.4 behind Authentik. Authentik says the login was successful, but the callback opens in the regular browser and the Desktop app stays stuck on the loading screen. Signing in through a normal browser works fine. I also tested the same account with Open WebUI's email/password login in the Desktop app. That works and stays signed in after quitting and reopening the app, so the problem seems limited to the OAuth handoff between the browser and Desktop. Tested September 30, 2026. Happy to test a fix if that helps. |
|
Remote instances are no longer a part of the scope of Desktop, https://github.com/open-webui/tether may address this in the future. |

Uh oh!
There was an error while loading. Please reload this page.
OAuth via Authentik fails to sign in. During redirect the web view opens a browser window instead and doesn't complete the handshake leading to the following error on the server. Signing into the website in a browser works fine.
authlib.integrations.base_client.errors.MismatchingStateError: mismatching_state: CSRF Warning! State not equal in request and response.All reactions