Login? #1

Closed
drnic opened this Issue Apr 28, 2012 · 12 comments

Projects

None yet

3 participants

@drnic
drnic commented Apr 28, 2012

How do I login/oauth with github?

@drnic
drnic commented Apr 28, 2012

Currently I'm getting an error like this (no prompt for login):


$ ghc repo create -o engineyard                                rvm:ruby-1.9.3-p194@global 

  Github CLI client

/Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/github_cli-0.1.3/lib/github_cli/commands/repositories.rb:43:in `create': undefined local variable or method `user' for #<GithubCLI::Commands::Repositories:0x007fe37b0335e8> (NameError)
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor.rb:205:in `block in subcommand'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/gems/github_cli-0.1.3/bin/ghc:6:in `<top (required)>'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/bin/ghc:19:in `load'
    from /Users/drnic/.rvm/gems/ruby-1.9.3-p194@global/bin/ghc:19:in `<main>'
@piotrmurach
Owner

Hi @drnic

That's cool that you're taking this gem up for a spin.

I've released new version 0.2.0 which fixes few issues including repository creation.

In order to authenticate/login you need to initialise a configuration file in your home directory

ghc init

Then

ghc repo create --org=engineyard --params=name:'engineyard' description:'Test repo for engineyard.'

You won't get anything informative in stdout as I am still working on display things in nicely formatted way. Nevertheless the repo should be created fine.

Best
P

@drnic
drnic commented Apr 29, 2012

Ok, thanks for pointing that out. I get the following:

$ ghc init

  Github CLI client

Please specify your GitHub Authentication Token (register on github.com to get it):

Is this the auth token that they recently deprecated? and aren't generating for new accounts? https://github.com/blog/1090-github-api-moving-on

@drnic
drnic commented Apr 30, 2012

Actually, where is this auth token now? Did github stop showing it on the Account section?

@piotrmurach
Owner

The way I go about it is to use GitHub authorizations api. Basically you use your basic credentials to create oauth token, you can supply various scopes to restrict the access(I think scope: 'repo' provides you with the rights to creating repositories, for more details http://developer.github.com/v3/oauth/). Currently you need to use 'github_api' gem for that as CLI client does not implement it yet(will add it later today if you care to wait)

github = Github.new :basic_auth => 'login:password'
github.oauth.create 'scopes' => ['repo']

In order to see your current list of authorizations/tokens do

github.oauth.list

Let us know if it helps.

@drnic
drnic commented Apr 30, 2012

Ok, I can wait. When the whole experience of using GitHub CLI to signin (I'll create another ticket about removing ghc init) and create a repo (public and private), I'll move this project into appscrolls, and I'll deprecate the github-gem project.

Cheers
Nic

Dr Nic Williams - VP Developer Evangelism
Engine Yard
The Leading Platform as a Service
Mobile: +1 415 860 2185
Skype: nicwilliams
Twitter: @drnic

On Monday, April 30, 2012 at 5:28 AM, Piotr Murach wrote:

The way I go about it is to use GitHub authorizations api. Basically you use your basic credentials to create oauth token, you can supply various scopes to restrict the access(I think scope: 'repo' provides you with the rights to creating repositories, for more details http://developer.github.com/v3/oauth/). Currently you need to use 'github_api' gem for that as CLI client does not implement it yet(will add it later today if you care to wait)

github = Github.new :basic_auth => 'login:password'
github.oauth.create 'scopes' => ['repo']

In order to see your current list of authorizations/tokens do

github.oauth.list

Let us know if it helps.


Reply to this email directly or view it on GitHub:
#1 (comment)

@piotrmurach
Owner

I've added the authorizations commands to the new release 0.2.1. However to make use of any of these commands you need basic authentication credentials which I haven't implemented yet due to blood-shot eyes:) I'm sorry you will need to embrace yourself in patience.

Best
P

@drnic
drnic commented Apr 30, 2012

Consider me embraced.

Dr Nic Williams - VP Developer Evangelism
Engine Yard
The Leading Platform as a Service
Mobile: +1 415 860 2185
Skype: nicwilliams
Twitter: @drnic

On Monday, April 30, 2012 at 2:38 PM, Piotr Murach wrote:

I've added the authorizations commands to the new release 0.2.1. However to make use of any of these commands you need basic authentication credentials which I haven't implemented yet due to blood-shot eyes:) I'm sorry you will need to embrace yourself in patience.

Best
P


Reply to this email directly or view it on GitHub:
#1 (comment)

@piotrmurach
Owner

@drnic - This issue hasn't disappeared from my radar! The gem underwent some heavy development, it's still not finished e.i. implementing the whole GitHub API but should be much more polished version. The executable is now called gcli and provides more complete interface. Please give it another try and let me know what you think of it?

Best
Piotr

@piotrmurach
Owner

Hi Dr Nic, I am gonna close this issue due to its vintage state. If you have any comments/suggestions I would be more than happy to work on them so please feel free to open new issues.

@aspiers
aspiers commented Mar 6, 2013

IMHO it didn't make sense to close this issue because the problem still exists. Submitted as #7.

@piotrmurach piotrmurach reopened this Mar 23, 2013
@piotrmurach
Owner

This is resolved, for further explanations and documentation please see #7 (comment)

@piotrmurach piotrmurach closed this Jun 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment