How to specify sign-in policies for Azure AD B2C for a Xamarin.Forms (iOS) app?

Kaush76Kaush76 AUMember
edited September 2015 in Xamarin.Forms

Hi,

My current status is: Xamarin Noob

I have used the following sample iOS project as provided here: https://blog.xamarin.com/put-adal-xamarin-forms/

The sample is pretty straight forward and I can get ADAL to load the login view and request user authentication, all good.
Now, I intend to take it a little further by showing a login view with multiple identity providers (G+, Twitter, Fb, etc).

In a web application, I can see multiple identity providers when I request for authentication as we can specify the policies in the web.config like so:

<add key="ida:Tenant" value="sometenant.onmicrosoft.com" /> <add key="ida:ClientId" value="clientidguid" /> <add key="ida:ClientSecret" value="clientsecret" /> <add key="ida:AadInstance" value="https://login.microsoftonline.com/{0}{1}{2}" /> <add key="ida:RedirectUri" value="https://localhost:44321/" /> <add key="ida:SignUpPolicyId" value="b2c_1_xyz_policy" /> <add key="ida:SignInPolicyId" value="b2c_1_xyz_sign_in" /> <add key="ida:UserProfilePolicyId" value="b2c_1_xyz_editing" />

I have the same redirect uri that I've used in the app (I have also tried to use the redirect uri for Native client with no luck )

I was wondering, how do I specify policies in a Xamarin forms project so that I can see multiple identity providers for user sign-in``?

Thanks in advance!

Cheers,
--Kaush.

Answers

  • Kaush76Kaush76 AUMember

    Sorry, the web.config snippet got replaced with blanks, here's the snippet again:

    <add key="ida:Tenant" value="sometenant.onmicrosoft.com" /> <add key="ida:ClientId" value="clientidguid" /> <add key="ida:ClientSecret" value="clientsecret" /> <add key="ida:AadInstance" value="https://login.microsoftonline.com/{0}{1}{2}" /> <add key="ida:RedirectUri" value="https://localhost:44321/" /> <add key="ida:SignUpPolicyId" value="b2c_1_xyz_policy" /> <add key="ida:SignInPolicyId" value="b2c_1_xyz_sign_in" /> <add key="ida:UserProfilePolicyId" value="b2c_1_xyz_editing" />

  • Kaush76Kaush76 AUMember

    Ended up resolving this by myself.
    To view the solution please go over to stackoverflow

    Happy coding! :)

Sign In or Register to comment.