Skip to content

OAuth2 authentication fails once after access_token expired.  #1775

Open
@r-hans

Description

@r-hans

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    auth-issueAn issue authenticating to a host

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions