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

What happens when using storage helper osxkeychain? #44

Closed
hydrajump opened this issue Dec 16, 2023 · 4 comments
Closed

What happens when using storage helper osxkeychain? #44

hydrajump opened this issue Dec 16, 2023 · 4 comments

Comments

@hydrajump
Copy link

hydrajump commented Dec 16, 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.

Originally posted by @hickford in #42 (comment)

Does this mean that the OAuth token never expires when using the default configuration below?

[credential]
	helper = osxkeychain
	helper = oauth
@hickford
Copy link
Owner

hickford commented Dec 16, 2023

periodically I have to run the git command twice

You'll find that authentication fails once every two hours, because Git tries to use an expired token. Git immediately erases the invalid credential, so repeating the command will generate a fresh OAuth token and succeed.

This problem only occurs with GitLab, BitBucket and Gitea. It doesn't occur with GitHub because GitHub's OAuth tokens never expire.

@hickford hickford changed the title Is the oauth token long-lived when using osxkeychain? What happens when using storage helper osxkeychain? Dec 16, 2023
@hydrajump
Copy link
Author

hydrajump commented Dec 25, 2023

To make sure I understand what you're saying:

You'll find that authentication fails once every two hours,

This is only applicable when the cache helper is used and a timeout of 7200 is set, correct?

Config:

[credential]
	helper = cache --timeout 7200
	helper = oauth

This problem doesn't occur with GitHub because GitHub's OAuth tokens never expire.

Right when the osxkeychain is used to store the oauth token it never expires. This was what I wanted to confirm when I created this issue :)

Config:

[credential]
	helper = osxkeychain
	helper = oauth

AFAICT it doesn't make sense to combine the cache and osxkeychain helpers as shown below. Do you agree?

Config:

[credential]
	helper = cache --timeout 7200
	helper = osxkeychain
	helper = oauth

@hickford
Copy link
Owner

hickford commented Mar 3, 2024

@hickford
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants