由于Microsoft Graph API不具备管理B2C AD用户的功能,因此从其中一个文档我们被要求使用ADAL,它需要在ADAL中创建特殊应用程序Azure AD B2C租户。创建了一个应用程序密钥,以从xamarin.ios应用程序提供API访问。异常访问使用ADAL库进行用户管理的Azure AD B2C
AuthenticationContext authContext = new AuthenticationContext(authority);
credential = new ClientCredential(clientId, GraphClientSecret);
authResult = await authContext.AcquireTokenAsync(graphResourceUri, credential);
在AcquireTokenAsync呼叫我们得到一个异常
AcquireTokenHandlerBase.cs: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.IdentityModel.Clients.ActiveDirectory.BrokerHelper.get_CanInvokeBroker() [0x0000c] in <786d1e888b334ad993ac80d2bc3b6e92>:0
at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase+<RunAsync>d__55.MoveNext() [0x00389] in <97581c6894a642ef95d008cded8ad4ac>:0
如果我改变调用删除的凭据,我只是得到一个登录界面。
包使用:
采取的任何帮助,将不胜感激。
非常感谢。 – Jeeva