Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OAuth Token Authorization #5

Merged
merged 1 commit into from
Apr 30, 2020
Merged

Conversation

Semidio
Copy link
Contributor

@Semidio Semidio commented Feb 16, 2019

Add OAuth Token Authorization to support 2-factor protected account.

Add OAuth Token Authorization to support 2-factor protected account.
@ceremcem
Copy link
Owner

ceremcem commented Feb 16, 2019

Thanks for the PR. I've enabled the two-factor authentication for my account to test the code. However, I'm not able to create a gist with

$ lsusb | create-gist.sh 266978
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   692  100    93  100   599    148    956 --:--:-- --:--:-- --:--:--  1105
----- ERROR -----
{
  "message": "Bad credentials",
  "documentation_url": "https://developer.github.com/v3"
}
-----------------

(where 266978 is my token). Would you provide an example usage?

@Semidio Semidio closed this Feb 16, 2019
@Semidio Semidio reopened this Feb 16, 2019
@Semidio
Copy link
Contributor Author

Semidio commented Feb 16, 2019

You should use GitHub Personal access tokens with atleast Gist permission enabled, which you could generate it at https://github.com/settings/tokens

@ceremcem
Copy link
Owner

So the procedure is:

  1. Go to https://github.com/settings/tokens/new and generate a new token with create gist permission.
  2. Use the token for authentication:
lsusb | create-gist.sh your-token-here

This nicely works. However, the changes break the current (simple) authentication style.

Would you mind adding this feature with --token switch or by reading from a configuration file maybe?

@ceremcem ceremcem merged commit 0bd25bd into ceremcem:master Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants