LoginSignup
4
0

More than 1 year has passed since last update.

Azure AD の "AADSTS700016: Application with identifier 'xxxxx' was not found in the directory" エラーについて

Last updated at Posted at 2021-05-22

SAML の場合

エラー メッセージ

AADSTS700016: Application with identifier 'https://random.com' was not found in the directory 'テナント ID'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.

SAML Request 内の Issuer の値が、アプリの識別子 (Name ID) と一致しないので怒られてる。

SAML リクエスト内の Issuer 要素を見てみよう

<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">https://random.com</saml:Issuer>

https://random.com を指定してる。

Azure AD の エンタープライズ アプリケーションの設定

確認画面 : Azure ポータル > [Azure Active Directory] > [エンタープライズ アプリケーション] > (対象のアプリ) > [シングル サインオン] > [基本的な SAML 構成]

確認項目 : [識別子 (エンティティ ID)]

SAML Request 内の Issuer で指定する値は、ここで設定されている識別子のいずれかに一致しなきゃいけない。

image.png

Open ID Connect の場合

エラー メッセージ

AADSTS700016: Application with identifier '7880db84-e5c4-4c55-87a5-7db9f5031ac6' was not found in the directory '17ebfadb-0bd6-49fe-8dce-a28191113160'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.

リクエスト内で client_id パラメーターで指定している値が、アプリの識別子 (アプリケーション ID) と一致しないので怒られている。

リクエスト内の client_id 要素を見てみよう

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=7880db84-e5c4-4c55-87a5-7db9f5031ac6&response_type=id_token...

"7880db84-e5c4-4c55-87a5-7db9f5031ac6" を指定している。

Azure AD の エンタープライズ アプリケーションの設定

確認画面 : Azure ポータル > [Azure Active Directory] > [エンタープライズ アプリケーション] > (対象のアプリ)

確認項目 : [アプリケーション ID]

リクエスト内の client_id パラメーターで指定する値は、"アプリケーション ID" と一致しなきゃいけない。

image.png

今回のエラーはアプリケーション ID ではなくオブジェクト ID を指定してしまっていたパターン。

4
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
4
0