简体   繁体   中英

Git/github command line app that uses oauth tokens to authenticate?

I wish to use a simple command line client (such as the official git client) to clone branches from github as part of a deploy tool.

For security, I do not wish to use basic (username/password) authentication. As I am already using github's oauth-token based Auth headers in my app, I was wondering if there is a command-line app that can use oauth tokens to authenticate to github .

Thanks!

Update Sep 2012

Github now accepts the use of auth tokens using any git client .

You can get a oauth token for github using these instructions , here's a practical demo using Node.js and superagent.

var GITHUB_API_ENDPOINT = 'https://api.github.com/'

superagent
  .post(GITHUB_API_ENDPOINT+'authorizations')
  .auth('username', 'notactuallymypassword')
  .send({ scopes: 'repo', note: 'Social Ops Deployer' })
  .end(function(res){
    if (res.ok) {
     console.log('yay got ' + JSON.stringify(res.body));
    } else {
     console.log('Oh no! error ' + res.text);
    }
  });

I haven't heard of any.

And you probably already discovered the official documentation on this topic describing how such client could be developed.

But I think it might create additional development overhead and probably introducing bugs, so maybe it's worth to try different approaches to solving this issue? For example:

  • using ssh protocol to retrieve data from github;
  • introducing new user in the team with 'pull-only' permissions and using his credentials.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM