Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication fails periodically when using git-credential-osxkeychain #42

Closed
abh opened this issue Dec 11, 2023 · 3 comments
Closed
Labels
help wanted Extra attention is needed

Comments

@abh
Copy link

abh commented Dec 11, 2023

[Periodically] when authenticating to Gitea I have to run the git command twice -- first it fails, the second time my browser opens and I get a new token.

Is that expected or is my configuration making it happen?

% git push gitea
remote: Verify
fatal: Authentication failed for 'https://gitea.example.com/org/project.git/'

This is my configuration:

[credential]
        helper = osxkeychain  # merged from /usr/local/...
	helper = cache --timeout 7100
	helper = oauth

[credential "https://gitea.example.com"]
        helper = oauth
	# https://docs.gitea.com/development/oauth2-provider
	oauthClientId = a4792ccc-144e-407e-86c9-5e7d8d9c3269
	oauthScopes = read_repository
	oauthAuthURL = /login/oauth/authorize
	oauthTokenURL = /login/oauth/access_token
@hickford
Copy link
Owner

hickford commented Dec 11, 2023

This happens because git-credential-osxkeychain doesn't store attributes password_expiry_utc and oauth_refresh_token . These are necessary for OAuth token refresh.

If you have the expertise, please take a look:

Help wanted from a Mac OS C developer to add password_expiry_utc and oauth_refresh_token support to git-credential-osxkeychain. This could follow the design of git-credential-libsecret.

@hickford hickford changed the title fatal: Authentication failed for ... error when cache expires Authentication fails periodically when using git-credential-osxkeychain Dec 11, 2023
@hickford hickford added the help wanted Extra attention is needed label Dec 11, 2023
@hickford
Copy link
Owner

hickford commented Mar 6, 2024

@hickford
Copy link
Owner

Fixed in Git 2.45 https://github.com/git/git/commits/v2.45.0/contrib/credential/osxkeychain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants