Skip to content

Cred.sshKeyNew not working: Too many redirects or authentication replays #511

@dcodeIO

Description

@dcodeIO

Hello everyone,

I am trying to automate pushing to a GitHub repository using NodeGit.Cred.sshKeyNew, but it looks like I am not able to get this working somehow. NodeGit.Cred.userpassPlaintextNew works just fine.

This is what I have:

}).then(function(remoteResult) {
    remote = remoteResult;
    remote.setCallbacks({
        credentials: function(url, userName) {
            return nodegit.Cred.sshKeyNew(
                userName,
                path.join(__dirname, "..", "..", "data", "mykey-rsa.pub"),
                path.join(__dirname, "..", "..", "data", "mykey-rsa"),
                "myPass"
            );
        }
    });
    return remote.connect(nodegit.Enums.DIRECTION.PUSH);
})

Which always results in: Error: Too many redirects or authentication replays.

I did double check that:

  • paths to the public and private key files are correct
  • the key is properly installed on GitHub
  • the key has been generated with ssh-keygen -t rsa
  • the key's password is correct

Am I doing something wrong there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions