title: Has anyone successfully implemented Azure Active Directory B2C for auth using Microsoft.Identity.Client 1.1.0-preview?
body: <p>I have been struggling with this for several days (three actually). I have AAD B2C working on a web app and an api. I cannot get it running on my Xamarin mobile project. I am using the UWP project to test my configuration since it has the easiest app to troubleshoot on a Windows 10 machine. I am using Visual Studio 2015 Pro.</p>
  
  <p>I am using the Microsoft.Identity.Client 1.1.0-preview.
  I used this as my starting point for my attempt to implement.</p>
  
  <p><a href="https://github.com/Azure-Samples/active-directory-b2c-xamarin-native" rel="nofollow noreferrer">https://github.com/Azure-Samples/active-directory-b2c-xamarin-native</a></p>
  
  <p>Right now the project will compile and launch. When I click on Sign in, I get a WebView, but it doesn't look exactly right....
  [First Image in Screenshots]</p>
  
  <p>Here are my variables...</p>
  
  <pre><code>public class Constants
  {
  public static string ApplicationID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
  public static string[] Scopes = {""};
  public static string SignUpSignInPolicy = "B2C_1_Standard_SignUpSignIn";
  public static string ResetPasswordPolicy = "B2C_1_Standard_PasswordReset";
  public static string EditProfilePolicy = "B2C_1_Standard_EditProfile";
  
  public static string Authority = "https://login.microsoftonline.com/[MyTennantName].onmicrosoft.com/B2C_1_Standard_SignUpSignIn";
  public static string AuthorityEditProfile = "https://login.microsoftonline.com/[MyTennantName].onmicrosoft.com/B2C_1_Standard_EditProfile";
  
  public static string ApiEndpoint = "https://[MyTennantName].onmicrosoft.com/apiservices";
  
  public static UIParent UiParent = null;
  }
  </code></pre>
  
  <p>My Login method is....</p>
  
  <pre><code>async void OnSignInSignOut(object sender, EventArgs e)
  {
      try
      {
          if (btnSignInSignOut.Text == "Sign in")
          {
              AuthenticationResult ar = await App.PCA.AcquireTokenAsync(Constants.Scopes, GetUserByPolicy(App.PCA.Users, Constants.SignUpSignInPolicy), Constants.UiParent);
              UpdateUserInfo(ar);
              UpdateSignInState(true);
          }
          else
          {
              foreach (var user in App.PCA.Users)
              {
                  App.PCA.Remove(user);
              }
              UpdateSignInState(false);
          }
      }
      catch (Exception ex)
      {
          // Checking the exception message 
          // should ONLY be done for B2C
          // reset and not any other error.
          if (ex.Message.Contains("AADB2C90118"))
              OnPasswordReset();
          // Alert if any exception excludig user cancelling sign-in dialog
          else if (((ex as MsalException)?.ErrorCode != "authentication_canceled"))
              await DisplayAlert($"Exception:", ex.ToString(), "Dismiss");
      }
  }
  </code></pre>
  
  <p>However before I can even enter my password I get the following....
  [Second image in Screenshots]</p>
  
  <p>My application definition looks like this...[Third image in screenshots]</p>
  
  <p>I don't think it is recognizing my tenant and trying to log me in with a Microsoft account. I have double checked my Tenant name and Application ID.</p>
  
  <p><a href="https://i.stack.imgur.com/9AsSI.jpg" rel="nofollow noreferrer">Screenshots</a></p>
  
  <p>I don't have enough reputation to post more than one link and one picture.</p>
  
  <p>Also, the Azure AD B2C api application works for a web app. I have created a web app that can authenticate and works with the API.</p>