Since Microsoft Graph API doesn't have the feature to manage B2C AD Users, from one of the docs we have been asked to use ADAL which required to create a special application in the Azure AD B2C tenant. Created an application key to provide API access from the xamarin.ios app.
AuthenticationContext authContext = new AuthenticationContext(authority);
credential = new ClientCredential(clientId, GraphClientSecret);
authResult = await authContext.AcquireTokenAsync(graphResourceUri, credential);
At the AcquireTokenAsync call we are getting an exception
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
If I change that call to removing the credentials, I just get a login screen.
Packages used:
Sample was taken from Sample from Docs
Any help would be greatly appreciated.