FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

2 Step Authentication · Issue #323 · nodegit/nodegit · GitHub

Repository navigation

2 Step Authentication #323

Description

A little reminder for people who are using 2 step authentication (I lost a fair while to this 😞 ). You will not be able to use anything other than a SSH connection when using nodegit to operate remotely. If you're finding that any remote operations are just hanging, this is most likely the cause.

Example:

var nodegit = require('nodegit'),
    clone = nodegit.Clone.clone,
    userpassPlaintextNew = nodegit.Cred.userpassPlaintextNew,
    user = 'my-user-name',
    pass = 'a-very-secret-password', 
    path = '/tmp/somewhere',
    options = {
      remoteCallbacks: {
        credentials: function () {
          return userpassPlaintextNew(user, pass);
        }
      }
    };

function url() {
    var url = 'https://'
    url += encodeURIComponent(user);
    url += ':';
    url += encodeURIComponent(pass);
    url += '@github.com/some-user/some-project.git',
    return url;
}

clone(url(), path, options)
  .then(function (repo) {
    console.log('IF YOU\'RE USING 2 STEP AUTH THIS WILL NEVER HAPPEN!');
  });

It's very difficult for automated services to get by 2 step authentication...that's why it's there. I'd recommend using other credentials until there's support for some kind of manual intervention.

Activity

tbranyen commented on Dec 8, 2014

Member

I just tested this with a private repository on my GitHub account (two-way auth). I'm not sure why, but I received a segfault, never saw it even hit the credentials callback.

maxkorp commented on Dec 8, 2014

Collaborator

O.o

I can't find anything about 2factor anywhere in the libgit2 docs, or on stack overflow, including searching for libgit2csharp and rugged. We might have to get in touch with them...

maxkorp commented on Jan 30, 2015

Collaborator

Added an example from this which should be on master soon of how to get this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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


      Back | FazBrowse Home | New Git URL