🖥

Github API | 二段階認証を設定しているアカウントから利用する

2023/08/26に公開

二段階認証を設定していると、正しいパスワードを入力しても認証が出来ない。

curl -u YumaInaura https://api.github.com
$ curl -u YumaInaura https://api.github.com
Enter host password for user 'YumaInaura':
{
  "message": "Must specify two-factor authentication OTP code.",
  "documentation_url": "https://developer.github.com/v3/auth#working-with-two-factor-authentication"
}

トークン作成

https://github.com/settings/tokens からトークンを作ってしまうのが早そう。

image

再実行

curl -u YumaInaura:[発行されたトークン] https://api.github.com

結果

応答あり。

image

参考

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2017-05-15

Discussion