0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure App Service の Easy Auth で認証済みユーザーのセキュリティグループ情報を取得してみた

Posted at

例えば Web アプリケーションで、認証済みユーザーに関連する何かしらの情報を用いて、管理者ユーザーなのか一般ユーザーなのかを判別し使用するメニューや機能を出し分けたいとします。大抵の場合は、データベース内にユーザー情報を管理するテーブルを用意して利用するのですが、Azure App Service の場合は、Easy Auth という組み込みの認証方法があり、設定によって認証済みユーザーのセキュリティグループ情報が取得できるため、これを利用する設計にすればデータベースに情報をもっておく必要がありません。という事で、実際に試してみました。

Easy Auth 設定画面から Entra ID アプリケーションに移動

appservice-easyauth-securitygroup-00.png

Microsoft Graph アプリ マニフェストを編集

groupMembershipClaimsnullSecurityGroup に変更します。

appservice-easyauth-securitygroup-01.png

Web アプリケーションの認証後 /.auth/me でセキュリティグループの Object ID を確認

appservice-easyauth-securitygroup-02.png

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?