I’m developing a Xamarin app that uses Azure AD B2C and I’m having some trouble.
Even though I have LinkedIn, Google, Microsoft, Facebook, and Twitter setup as Identity Providers, the only thing I am ever prompted for is my Microsoft account. I don’t see any of the other buttons when my app invokes the login. Works great for Microsoft login, can’t access any of the others.
Here is my call to AcquireTokenAsync:
var result = await AuthenticationClient.AcquireTokenAsync(Constants.Scopes,
GetUserByPolicy(App.AuthenticationClient.Users, Constants.PolicySignUpSignIn),
Evaluator.App.UiParent);
In the Azure AD B2C settings in the portal, I have Web App / Web API set to NO, Native client set to YES. The Custom Redirect URI is “masl{myappid}://auth”.
Under Keys it says “No results”.
Under API access (Preview) it says there are 2 scopes (both checkboxes checked for openid and offline_access).
Under published scopes (Preview) it says Web app / Web API has not been included.
Under Identity providers, I have LinkedIn, Google, Microsoft, Facebook, and Twitter configured.
2
Answers
It turns out that changing to use one of the other overloads of AcquireTokenAsync causes different behavior.
The original call caused the Azure AD service to be called, and the call shown here causes the Azure B2C service to be called instead. I don't see that documented anywhere, and I wish all the overloads had better documentation describing the relevance and distinctions in behavior between them.
Now I see all the providers I had configured showing up as options! However, there's a new problem in that (despite the fact that they appear to be configured correctly) I no longer get an email address back in the
result.User.DisplayableId
field. Despite this, my original question is answered.Configure your Policy Identity Providers (IDPs)
Sample Policy