Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

2 Step Authentication #323

Copy link
Copy link
@johngeorgewright

Description

@johngeorgewright
Issue body actions

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.

Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.