2016-07-15 54 views
1

我從一位使用Azure AD B2C的同事接管了項目的一部分。從Azure AD獲取用戶B2C:此API版本不支持

目前我們使用old Azure portal中的用戶列表來獲取用戶的認證令牌,然後我們可以將其綁定到我們自己的數據庫中的用戶條目。即我們複製和粘貼從這裏列:

Azure Portal (old) screenshot

這將是更爲明智的編程方式做到這一點。

文章Azure AD B2C Preview: Use the Graph API包括下載示例代碼。爲了讓它運行,我需要這些東西:

<appSettings> 
    <add key="b2c:Tenant" value="[Enter tenant name, e.g. contoso.onmicrosoft.com]" /> 
    <add key="b2c:ClientId" value="[Enter the client ID (a.k.a AppPrincipalId) as obtained from the Azure AD Powershell, e.g. 82692da5-a86f-44c9-9d53-2f88d52b478b]" /> 
    <add key="b2c:ClientSecret" value="[Enter the client secret that you generated, e.g. ONHJGaI232VenJIboyg8hmTlyNXh0Ef0brRRRNWBRfc=]" /> 
</appSettings> 

我可以得到租戶和新Azure的門戶網站的門戶應用程序ID:

Azure portal (new) screenshot

和我的同事已通過我的客戶端祕密從他製作目錄的時候開始。

繼文章中,我現在編譯應用程序並運行

B2C獲取用戶

但不是用戶從我們的Azure的AD B2C目錄的預期列表我得到錯誤信息

AADSTS70001:此API版本不支持應用程序my-app-id。
跟蹤ID:一個全局唯一標識符
相關ID:另一個全局唯一標識符
時間戳:2016年7月15日10:27:15Z

如何編程得到用戶在我的Azure的AD B2C目錄?

回答