針對使用 OData 摘要登入進行疑難解答

本文包含針對 OData 摘要使用組織帳戶登入時的疑難解答選項:

  • 不支援認證類型錯誤
  • 拒絕存取錯誤

下列各節會說明每個錯誤,並接著說明補救這些錯誤的步驟。

不支援認證類型

您可能會看到下列錯誤,指出不支援認證類型:

We are unable to connect because this credential type is not supported 
by this resource. Please choose another credential type.

您必須確定您的服務正在傳送驗證標頭,如下所示:

  • 第一個沒有授權標頭的 Oauth 要求應該傳送下列標頭以回應:

    www-authenticate: Bearer realm=https://login.microsoftonline.com/<Your Active Directory Tenant Id> 
    
  • 將要求重新導向至設定為 Bearer 的授權標頭的服務,應傳送下列標頭以回應:

    www-authenticate: Bearer authorization_uri=https://login.microsoftonline.com/<Your Active Directory Tenant Id>/oauth2/authorize
    

成功重新導向呼叫之後,對服務的呼叫在授權標頭中具有正確的存取令牌。 如果您仍然看到錯誤,請清除 OData 服務 URI 的全域許可權 ,然後再試一次。 若要清除全域許可權,請移至 [檔案>選項] 和 [設定>][數據源] 設定> [全域許可權]。

拒絕存取

您可能會看到下列其中一個錯誤,指出存取遭到拒絕:

access_denied: AADSTS650053: The application 'Microsoft Power Query for Excel' 
asked for scope 'user_impersonation' that doesn't exist 
on the resource \<resourceId\>.
Microsoft Power Query for Excel needs permission to access resources 
in your organization that only an admin can grant. 
Ask an admin to grant permission to this app before you can use it.

如果您遇到這類錯誤,請確定 OData 服務的應用程式註冊具有下列設定:

  • 應用程式標識碼 會設定為 OData 服務基底 URI。
  • 定義範圍 user_impersonation
  • 系統管理員會適當地設定應用程式的許可權。

您可以使用 Power BI Desktop 執行各種工作。 如需其功能的詳細資訊,請參閱下列資源: