GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — Working with two-factor authentication by ddimitrioglo · Pull Request #450 · github-tools/github ConversationAs mentioned in github API: And we will be able to use it like this:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsAs mentioned in github API:
```
In addition to the Basic Authentication credentials, you must send the user's authentication code (i.e., one-time password) in the X-GitHub-OTP header.
```
And we will be able to use it like this:
```
const github = new GitHub({
username: 'ddimitrioglo',
password: 'xxxxxxxxxxxx',
otp: '888999' // <= One-Time-Password
});
let me = github.getUser();
me.listRepos((err, repos) => {
console.log(repos);
});
```
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
@j-rewerts I think to add tests for this we'd have to create a test user, set them up with OTP, and then commit the secret/salt/QR code/whatever so that we could use something like [this library][opt-lib] to generate the OTP during tests. (That library is not a specific recommendation, just doing a quick search to see if there is likely to be a library that will work) Thinking a bit more, we might need to have the configuration specify a callback that returns a current OTP value. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It seems like it could be possible. I'll sit on this for a bit and try to get something workable together. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.