簡體   English   中英

Azure 解析 OAuth2 回調時出現 AD 錯誤:invalid_client

[英]Azure AD error while parsing OAuth2 callback: invalid_client

我有一個應用程序在 Azure AD 中注冊,使用https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app嘗試登錄我的應用程序以連接到 Microsoft 登錄。 我收到無效的客戶端錯誤。 在日志中,我看到以下錯誤。

error=invalid_client&error_description="AADSTS650052 The app needs access to a service (https://aks-aad-server.azure.com) that your organization xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx has not subscribed to or enabled. Contact your IT Admin to review the configuration of your service subscriptions"

注意:我有 Microsoft Office 365 標准訂閱計划,

AADSTS650052 該應用程序需要訪問您的組織 xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx 尚未訂閱或啟用的服務 ( https://aks-aad-server.azure.com )。 聯系您的 IT 管理員以查看您的服務訂閱配置

要解決上述錯誤,請檢查以下解決方法

  • 在AD Azure注冊應用時,查看您選擇的支持的賬戶類型

  • 如果您選擇“單一租戶” ,您將無法登錄您的應用程序
    來自不同的租戶

  • 從支持的不同租戶更新訪問您的應用程序
    帳戶類型為“多租戶”

要詳細了解如何執行此操作,請參閱此鏈接:

https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-registration-to-be-multi-tenant

  • 注冊應用程序后,導航至Exposing an API設置 App ID URI添加所需的范圍,例如讀取、用戶模擬等。

  • 將應用程序的客戶端 ID 添加到清單中的knownClientApplications參數

您的管理員需要接受同意提示才能使用以下 URL 訪問此應用程序,方法是使用您的應用程序客戶端 ID 更新 ClientID 參數

https://login.microsoftonline.com/common/oauth2/authorize?client_id=1a8e25b8-xxxx-xxxx-xxxx-xxxxxxxxxxxx&prompt=admin_consent&response_type=code 

當您的管理員授予這些權限時,您可以成功登錄到您的應用程序

參考:

https://learn.microsoft.com/en-us/answers/questions/28697/invalid-client-aadsts650052-the-app-needs-access-t.html

在 oauth2-proxy 配置中發現了錯誤的scope ,它向 azure 發送了錯誤的請求,在更新scope以更正問題后,問題得到解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM