OAuth2 with MS Azure not working #3295

Closed
opened 2025-11-02 05:06:57 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Mr-Reca on GitHub (May 6, 2019).

  • Gitea version (or commit ref): 73ce024 with Go 1.12.1
  • Git version: 2.13.7
  • Operating system: openSUSE Leap 42.1
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I configured an Authentication Source using this guide https://blog.anoff.io/2019-03-23-configure-azure-ad-for-gitea/ so I can use Azure Active Directory for authenticate the users.

After the 2FA, the browser shows the error AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application. I checked the redirect_uri and it has this format: https://<host>:3000/user/oauth2/gitea/callback

gitea.log has this error when I go to that page (with error 500):
routers/user/auth.go:560 handleOAuth2SignIn()] [E] UserSignIn: could not find a matching session for this request

I'm using MariaDB Ver 15.1 Distrib 10.0.30-MariaDB

Screenshots

Originally created by @Mr-Reca on GitHub (May 6, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 73ce024 with Go 1.12.1 - Git version: 2.13.7 - Operating system: openSUSE Leap 42.1 - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description I configured an Authentication Source using this guide [https://blog.anoff.io/2019-03-23-configure-azure-ad-for-gitea/](url) so I can use Azure Active Directory for authenticate the users. After the 2FA, the browser shows the error `AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application`. I checked the redirect_uri and it has this format: `https://<host>:3000/user/oauth2/gitea/callback` gitea.log has this error when I go to that page (with error 500): `routers/user/auth.go:560 handleOAuth2SignIn()] [E] UserSignIn: could not find a matching session for this request` I'm using MariaDB Ver 15.1 Distrib 10.0.30-MariaDB ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/confirmed label 2025-11-02 05:06:57 -06:00
Author
Owner

@lunny commented on GitHub (May 7, 2019):

Have #6345 fixed your problem?

@lunny commented on GitHub (May 7, 2019): Have #6345 fixed your problem?
Author
Owner

@Mr-Reca commented on GitHub (May 7, 2019):

I tried #6345 before opening the issue

@Mr-Reca commented on GitHub (May 7, 2019): I tried #6345 before opening the issue
Author
Owner

@stale[bot] commented on GitHub (Jul 6, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 6, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3295