Skip to content

problem with Git Credential Manager when [oauth2].ENABLED=false, because of Www-Authenticate: Basic realm="Gitea" #35510

@gh-user-2022

Description

@gh-user-2022

Description

Problem noticed on attempt to update to newest Gitea version 1.24.6.
https://github.com/go-gitea/gitea/releases/tag/v1.24.6

When OAuth is disabled with [oauth2].ENABLED=false in app.ini, then Git Credential Manager tries to open non-existent URL http://<...>/login/oauth/authorize?<...> in browser.

Some minimal debugging shows that there is interplay between

ctx.Resp.Header().Set("WWW-Authenticate", `Basic realm="Gitea"`)
and https://github.com/git-ecosystem/git-credential-manager/blob/786ab03440ddc82e807a97c0e540f5247e44cec6/src/shared/Core/GenericOAuthConfig.cs#L17

In older versions of Gitea there was Www-Authenticate: Basic realm=".", so Git Credential Manager worked correctly.

ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=\".\"")

I wonder, how can this be somehow worked around.

Gitea Version

1.24.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.51.0.windows.1

Operating System

Microsoft Windows [Version 10.0.17763.7314]

How are you running Gitea?

Used package from https://github.com/go-gitea/gitea/releases/tag/v1.24.6
Run with commandline in directory C:\gitea with custom configuration in C:\gitea\custom\conf\app.ini

With

[oauth2]
ENABLED = false

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions