github-tools / github-tools/github
How to use basic auth with 2-factor authentication?
- 主要语言
- JavaScript
- 星标
- 3.8k
- 派生
- 809
- PR 合并指标
- 30 天内没有已合并 PR
描述
Is it possible to use basic auth with 2FA enabled on the user account? And if so, could someone provide me some brief sample code? I've tried adding a token field, but did not work. Got the "Bad Credentials" response from the API.
```
let github = new GitHub({
apiUrl: '**enterprise API endpoint here**',
username: parameter.username,
password: parameter.password,
token: parameter.token,
auth: 'basic'
});
let user = github.getUser();
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by locating the library's authentication implementation and existing API documentation; the issue names no file or test. Confirm the supported authentication flow for accounts with 2FA and document a verified JavaScript example, with the expected successful API response as the completion check.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- api, authentication
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100