Skip to content

Instantly share code, notes, and snippets.

@xl1
Last active September 4, 2022 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xl1/85efbc3bb7ae76f4d2fd89d14fd666de to your computer and use it in GitHub Desktop.
Save xl1/85efbc3bb7ae76f4d2fd89d14fd666de to your computer and use it in GitHub Desktop.
Azure App Service Authentication (Easy Auth) で GitHub login の scope を設定する

Azure App Service Authentication (Easy Auth) で GitHub login の scope を設定する

Azure App Service で GitHub ログインを要求するように設定できるが、 GitHub で OAuth App を作って連携した後の画面で、scope が設定できないようになっている

2022-09-05 010321

GitHub の場合、デフォルトだと public_repo のみが設定されているが、 たとえば取得したアクセストークンを利用してプライベートリポジトリにアクセスしたい場合は repo を設定する必要がある

これは portal からは変更できないので、ARM API や Azure Resource Explorer で変更するしかない。 Microsoft.Web/sites/<siteName>/config/authsettingsV2properties.identityProviders.gitHub.login.scopes を変更する

2022-09-05 011303

その後ログインを試行すると、private repo へのアクセスが要求されるようになることが確認できる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment