Skip to content

Commit

Permalink
Drop refs to create_authorization from README (#1640)
Browse files Browse the repository at this point in the history
These should've come out in 017b0e3.

Fixes #1639
  • Loading branch information
danbernier committed Oct 27, 2023
1 parent 0ffe565 commit a34a726
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,7 @@ user.login
# => "defunkt"
```

You can [create access tokens through your GitHub Account Settings](https://help.github.com/articles/creating-an-access-token-for-command-line-use)
or with a basic authenticated Octokit client:

```ruby
client = Octokit::Client.new(:login => 'defunkt', :password => 'c0d3b4ssssss!')

client.create_authorization(:scopes => ["user"], :note => "Name of token")
# => <your new oauth token>
```
You can [create access tokens through your GitHub Account Settings](https://help.github.com/articles/creating-an-access-token-for-command-line-use).

### Two-Factor Authentication

Expand All @@ -237,18 +229,6 @@ client = Octokit::Client.new \
user = client.user("defunkt", :headers => { "X-GitHub-OTP" => "<your 2FA token>" })
```

As you can imagine, this gets annoying quickly since two-factor auth tokens are very short lived. So it is recommended to create an oauth token for the user to communicate with the API:

```ruby
client = Octokit::Client.new \
:login => 'defunkt',
:password => 'c0d3b4ssssss!'

client.create_authorization(:scopes => ["user"], :note => "Name of token",
:headers => { "X-GitHub-OTP" => "<your 2FA token>" })
# => <your new oauth token>
```

### Using a .netrc file

Octokit supports reading credentials from a netrc file (defaulting to
Expand Down

0 comments on commit a34a726

Please sign in to comment.