hickford/git-credential-oauth

Error “Permission denied (publickey)”

gotcha opened this issue · 4 comments

gotcha commented

Hi,

I have tried to make git-credential-oauth work on my Mac but failed.

AFAICS, binary is properly installed:

% git credential-oauth
usage: git credential-oauth [<options>] <action>

Options:
  -verbose
        log debug information to stderr

Actions:
  get            Generate credential
  configure      Configure as Git credential helper
  unconfigure    Unconfigure as Git credential helper

See also https://github.com/hickford/git-credential-oauth

Querying git configuration with git config

% git config -l
credential.helper=osxkeychain
include.path=~/.config/git/git-credential-oauth.inc
credential.helper=osxkeychain
credential.helper=cache --timeout 7200
credential.helper=oauth
% git config credential.helper
oauth

When I try to push to github, this is what I get instead of launching a browser to ask authentication:

% git push -u origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Is there something obvious I am missing ?

gotcha commented

Answer to myself:

I should have known better that the remote should be through https and not through ssh+git.

Setting up the proper remote did fix my problem !

the remote should be through https and not through ssh+git

Indeed. I've edited the issue title to help anyone else with the same problem.

@gotcha Do you have any experience with C? git-credential-osxkeychain is missing support for credential attributes password_expiry_utc and oauth_refresh_token (#20). Adding support would improve the experience with hosts such as GitLab that require OAuth refresh every few hours.

gotcha commented

I do not have experience with C. Can just read when really needed. 😔