mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
issue: Microsoft Entra ID (OIDC) login results in a redirect loop #5957
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @josem-vexcel on GitHub (Aug 4, 2025).
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.18
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
Brave without extensions
Confirmation
README.md.Expected Behavior
The user should be logged in and redirected to the main chat interface.
Actual Behavior
When attempting to log in using Microsoft Entra ID (Azure AD) OIDC, the
authentication flow redirects back to the login page after successful
authentication with Microsoft. The browser console shows a Not found:
/oauth/callback/microsoft error, indicating the backend is not handling the
callback route.
Steps to Reproduce
To Reproduce
Logs & Screenshots
The backend logs show a successful GET /oauth/callback/microsoft?code=... request
with an HTTP 200 status code, but no subsequent token exchange or user creation
logs. There are no errors in the backend logs.
1 2025-08-04 10:49:48.442 | INFO |
uvicorn.protocols.http.httptools_impl:send:476 - 10.9.2.4:0 - "GET
/oauth/microsoft/login HTTP/1.1" 302 - {}
2 2025-08-04 10:49:49.501 | INFO |
uvicorn.protocols.http.httptools_impl:send:476 - 10.9.2.4:0 - "GET
/oauth/callback/microsoft?code=... HTTP/1.1" 200 - {}
3 2025-08-04 10:49:49.886 | INFO |
uvicorn.protocols.http.httptools_impl:send:476 - 10.9.2.4:0 - "GET
/manifest.json HTTP/1.1" 200 - {}
4 2025-08-04 10:49:50.401 | INFO |
uvicorn.protocols.http.httptools_impl:send:476 - 10.9.2.4:0 - "GET
/api/config HTTP/1.1" 200 - {}
The browser console shows the following error after being redirected to the
callback URL:
Ie: Not found: /oauth/callback/microsoft
The /api/config endpoint confirms that enable_signup is true:
1 {
2 "features": {
3 "auth": true,
4 "enable_signup": true,
5 ...
6 }
7 }
Configuration
docker-compose.yml:10 - WEBUI_NAME=Vexcel AI
11 - WEBUI_URL=https://chat.openai.vdp-prod.local
12 - WEBUI_AUTH=true
13 - ENABLE_OAUTH_SIGNUP=true
14 - MICROSOFT_CLIENT_ID=...
15 - MICROSOFT_CLIENT_SECRET=...
16 - MICROSOFT_CLIENT_TENANT_ID=...
17 -
MICROSOFT_REDIRECT_URI=https://chat.openai.vdp-prod.local/oauth/callback/m
icrosoft
18 - MICROSOFT_OAUTH_SCOPE="openid User.Read email profile"
19 -
OPENID_PROVIDER_URL=https://login.microsoftonline.com/{TENANT_ID}/v2.0
20 - WEBUI_SECRET_KEY=...
21 restart: always
22 networks:
23 - ai-network
Additional Information
Troubleshooting Steps Taken
Registration.
.env parsing issues.
Host and X-Forwarded-Proto headers. Also have the same issue from localhost:3000
was loaded from a fresh database.
Despite all configuration being correct, the backend consistently fails to handle
the callback route.
@nielsq commented on GitHub (Aug 8, 2025):
I had a similar issue.
downgrade to v0.6.10
see if that works
in v0.6.10 release notes they said:
let me know if that works. I don´t remember how i resolved it but lets see
@Classic298 commented on GitHub (Aug 8, 2025):
did you set the WEBUI_URL or not? this is a required variable to be set in the admin panel.
@josem-vexcel commented on GitHub (Aug 11, 2025):
@nielsq, unfortunately, I experience the same behavior in v0.6.10
@Classic298 I did set the value in the .env file
docker compose exec open-webui env | grep WEBUI_URLWEBUI_URL=https://chat.openai.my-domain.tldAlso, I can see the same value via the WebUI in the admin panel settings
Right now, I'm using v0.6.21 and still in a redirect loop.
@Classic298 commented on GitHub (Aug 11, 2025):
@josem-vexcel 0.6.10 is very old can you try a newer version
Did you disable all caching on your reverse proxy?
@josem-vexcel commented on GitHub (Aug 12, 2025):
I am using v0.6.21, and today I tried latest version (0.6.22) with no luck.
I don't think it's related to the proxy server because I had the same issue from http://localhost. Also cleared cache and cookies before each attempt.
I use nginx-proxy-manager in production, only have enabled "Websockets Support" and "Force SSL" with a self signed certificate
@Classic298 commented on GitHub (Aug 12, 2025):
@josem-vexcel
can you please confirm your OPENID_PROVIDER_URL is correct?
the one you provided in the issue description seems incorrect, at least when comparing it to my own config.
To me it looks like the path is generally wrong
after the tenant_id/
there should be /.well-known/openid-configuration
also, personally, I do not even have the MICROSOFT_REDIRECT_URI configured (the default value the env var would be set to, should match anyways)
Please attempt to correct the OPENID_PROVIDER_URL and temporarily comment out the redirect uri env var and see if that changes the behaviour.
@Classic298 commented on GitHub (Aug 12, 2025):
If all that didn't help, I am a bit lost and can only advise you to additionally check the (recently updated) troubleshooting section in the docs
https://docs.openwebui.com/troubleshooting/sso/
https://docs.openwebui.com/features/sso/
@josem-vexcel commented on GitHub (Aug 12, 2025):
@Classic298
I commented out MICROSOFT_REDIRECT_URI and applied your change to OPENID_PROVIDER_URL and now it works!
Thanks a lot, feel free to close the issue. Otherwise I'll do it. Thanks again.
@Classic298 commented on GitHub (Aug 12, 2025):
please do close it. I have yet to receive the permission here to close issues haha- maybe one day