git-ecosystem / git-ecosystem/git-credential-manager

OAuth2 authentication fails once after access_token expired.

Open
#1,775 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth-issue
Dominant language
C#
Stars
9.3k
Forks
2.9k
Avg merge
7d 1h
Merged PRs (30d)
14

Description

Version

2.5.0+d34930736e131ad80e5690e5634ced1808aff3e2, latest

Operating system

Windows

OS version or distribution

Windows 11

Git hosting provider(s)

Bitbucket Server/DC

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

None

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

After giving consent to the OAuth2 Token, gcm manages the token refresh without further user interaction in the background. This means, once the token expired, gcm refreshes the token automatically. Git can successfully authentication without error.

Actual behavior

After giving consent to the OAuth2 Token, git throws an authentication error once the access_token expired. This triggers the deletion of the access_token. During the follow-up execution of git, the missing access_token triggers the refresh of the OAuth Token with gcm and updates access/refresh_token as expected. However, as a user, I always have one initial git auth error after token expiration.

What can be seen from the error-log is, that gcm validates the auth_token, does not recognize that it is expired, and proceeds without refresh. This results in a 401 auth error and the deletion of the access_token.

failed_log.txt

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing failed_log.txt and trace the OAuth2 access-token validation and refresh flow described in the report. Reproduce the Windows 11 and Bitbucket Server/DC case around token expiry; done means the token refresh occurs before the first post-expiry Git authentication attempt, without an initial 401 or access-token deletion.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.