nhmood / watson-perl

MIT License
53 stars 14 forks source link

Github 2-factor auth / ability to manually enter token #32

Open knksmith57 opened 10 years ago

knksmith57 commented 10 years ago

Maybe I'm missing something, but I can't establish an OAuth token with this tool. That's totally cool, but then please provide some docs as to how to manually enter the info.

I've using the following (inspired by this post):

[github_api]
1234token_generated_from_github_control_panel_5678

[github_repo]
knksmith57/my_repo

[github_endpoint]
https://api.github.com

Here's what I get when I try to run it:

$ watson -r github
------------------------------
watson - inline issue manager
------------------------------
[ + ] Obtaining OAuth Token for GitHub...
Unknown section "github_api" at /some/path/to/bin/watson line 731, <$_[...]> line 23.

What am I missing here?

kevinjasker commented 10 years ago

Watson will set all of this for you.

Try deleting all github info from .watsonrc, and then

 $ watson -r github
knksmith57 commented 10 years ago

@kevinjasker it will, but only if the transaction is successful.

Example:

$ watson -r github
------------------------------
watson - inline issue manager
------------------------------

[ + ] Obtaining OAuth Token for GitHub...
[ ! ] Access to your GitHub account required to make/update issues
      See help or README for more details on GitHub/Bitbucket access

Username: knksmith57
Enter host password for user 'knksmith57':
[ x ] Unable to obtain OAuth Token

I'm fairly confident this has something to do with the fact that I have 2-factor auth enabled and this script isn't set up to handle it. I'm definitely entering my GitHub password correctly.

So, what I want are the lines in .watsonrc that this tool generates when that command is successful. Can't find working-official docs on them anywhere. Make sense?

kevinjasker commented 10 years ago

Have you tried generating an application specific password? That might be the easiest solution...

Edit - Github calls them "Personal Access Tokens"

knksmith57 commented 10 years ago
  1. Disabled 2-factor auth
  2. ran watson -r github
    • it returned successfully
    • nothing stored / updated in .watsonrc
  3. ran watson
    • didn't like any of my comments, even though I used the exact same syntax as the example vid
  4. changed every comment to just be [tag] Text
    • no errors when I run watson
  5. no issues are being created on GitHub, even though I can see that the watson label has been created.
  6. might pick up smoking to cope with this
kevinjasker commented 10 years ago

Give watson-ruby a try?

knksmith57 commented 10 years ago

@kevinjasker I think that's going to be my next move. Just tried a second ago but it wants >= 2.0 and my dev environment is all set up for 1.9.3 right meow. Maybe time to make either rbenv or RVM work properly on my machine?

Thanks for all of your help!

nhmood commented 10 years ago

@knksmith57 I would also recommend using watson-ruby over watson-perl (especially if you want to avoid step 6) as a lot of bugs and features have been added (such as 2FA) to the ruby version but not the perl version.

The perl version is going through a (super slow) rework to convert it to a modular, CPAN-friendly, version but as of right now it is pretty far behind the ruby version.

If you haven't already taken the dive into rbenv/RVM, I have a working 1.9.3 compatibility fix that I haven't checked in yet that I could hurry up and put out :), let me know.