Azure AD v2 OAUTH2 with Git #8936

Closed
opened 2025-11-02 08:23:36 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @Rainson12 on GitHub (May 10, 2022).

Description

When enabling azure ad OAUTH2, the user will be allowed to authenticate against the azure ad and login to the web ui. However when submitting code via git cli like using "git clone [URL]" the user will never be able to authenticate since the user is always prompted for username & password which seem to be authenticated against the gitea internal user directory but not the SSO. I would expect to be prompted with the azure ad authentication dialog which credentials are then used to authenticate against gitea.

Gitea Version

1.16.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.36.1.windows.1

Operating System

No response

How are you running Gitea?

we are running gitea inside docker

Database

PostgreSQL

Originally created by @Rainson12 on GitHub (May 10, 2022). ### Description When enabling azure ad OAUTH2, the user will be allowed to authenticate against the azure ad and login to the web ui. However when submitting code via git cli like using "git clone [URL]" the user will never be able to authenticate since the user is always prompted for username & password which seem to be authenticated against the gitea internal user directory but not the SSO. I would expect to be prompted with the azure ad authentication dialog which credentials are then used to authenticate against gitea. ### Gitea Version 1.16.6 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version git version 2.36.1.windows.1 ### Operating System _No response_ ### How are you running Gitea? we are running gitea inside docker ### Database PostgreSQL
GiteaMirror added the type/question label 2025-11-02 08:23:36 -06:00
Author
Owner

@lafriks commented on GitHub (May 11, 2022):

That is not technically possible as git client supports only username/password authentication flow. If Azure AD supports LDAP protocol that could theoretically be configured in gitea under authentication sources

@lafriks commented on GitHub (May 11, 2022): That is not technically possible as git client supports only username/password authentication flow. If Azure AD supports LDAP protocol that could theoretically be configured in gitea under authentication sources
Author
Owner

@wxiaoguang commented on GitHub (May 12, 2022):

@lafriks

There are more similar issues:

@wxiaoguang commented on GitHub (May 12, 2022): @lafriks There are more similar issues: * https://github.com/go-gitea/gitea/issues/19336 * https://github.com/go-gitea/gitea/issues/17350
Author
Owner

@lafriks commented on GitHub (May 12, 2022):

@wxiaoguang these are different issues, git client does not support oauth2 authorization workflow

@lafriks commented on GitHub (May 12, 2022): @wxiaoguang these are different issues, git client does not support oauth2 authorization workflow
Author
Owner

@wxiaoguang commented on GitHub (May 12, 2022):

Oh yeah, not exactly the same.

I was thinking about the problem that Gitea's git auth only use internal database. This one has another problem that git client doesn't support OAuth2. And Azure AD made me think about LDAP 😂

@wxiaoguang commented on GitHub (May 12, 2022): Oh yeah, not exactly the same. I was thinking about the problem that Gitea's git auth only use internal database. This one has another problem that git client doesn't support OAuth2. And `Azure AD` made me think about LDAP 😂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8936