title: Xamarin Microsoft.Identity.Client AuthenticationResult AccessToken is null
body: <p>I'm creating a Xamarin.Forms PCL application that uses Azure B2C to authenticate users.  I was previously using <code>Microsoft.Identity.Client</code> version 1.0.304142221-alpha but I just updated to 1.1.0-preview after it came out on NuGet.  </p>
  
  <p>I'm also using the Azure <code>MobileServiceClient</code> to login users so only authenticated users can make calls to my tables.  </p>
  
  <p>I am able to successfully authenticate, which I set up like <a href="https://github.com/Azure-Samples/active-directory-b2c-xamarin-native" rel="nofollow noreferrer">this sample on GitHub.</a></p>
  
  <p>Using the previous version of <code>Microsoft.Identity.Client</code>, I was able to login to the <code>MobileServiceClient</code> like this:</p>
  
  <pre><code>AuthenticationResult ar = await App.AuthenticationClient.AcquireTokenAsync(Config.Scopes, 
           string.Empty, UiOptions.SelectAccount, string.Empty, null, 
           Config.Authority, Config.SignUpSignInpolicy);
  
  JObject payload = getPayload(ar.IdToken);
  payload["access_token"] = ar.Token;
  string objectId = payload["oid"].ToString();
  
  MobileServiceUser u = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory,
                        payload);
  </code></pre>
  
  <p>However, after the update, <code>AuthenticationResult</code> no longer has a member named <code>Token</code>.  Instead, it has <code>AccessToken</code>, which for me, is always returning <code>null</code>.</p>
  
  <p>I have tried logging into the <code>MobileServiceClient</code> using the <code>IdToken</code>, but this produces an unauthorized error. </p>
  
  <p>I think this problem could have something to with the scopes I define.  Right now I have:</p>
  
  <pre><code>public static string[] Scopes = { "https://&lt;MyTennant&gt;/&lt;MyAPIName&gt;.read"};
  </code></pre>
  
  <p>Are there any scopes that I'm missing to get the <code>AccessToken</code> or is the problem somewhere else?</p>
  
  <p><strong>Update: Here are my settings in the Azure Portal</strong>
  For my API:
  <a href="https://i.stack.imgur.com/tTlJi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tTlJi.png" alt="My Azure B2C API Settings"></a></p>
  
  <p>For my Native Client:
  <a href="https://i.stack.imgur.com/sAehf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sAehf.png" alt="My Azure B2C Native Client Settings"></a></p>
  
  <p>In my App, I'm logging in like this:</p>
  
  <pre><code>AuthenticationResult ar = await App.AuthenticationClient.AcquireTokenAsync(Scopes, 
                       GetUserByPolicy(App.AuthenticationClient.Users, PolicySignUpSignIn),
                       App.UiParent);
  payload = getPayload(ar.IdToken);
  payload["access_token"] = ar.IdToken;
  
  var mobileService = new Microsoft.WindowsAzure.MobileServices.MobileServiceClient("https://giftthis.azurewebsites.net/.auth/");
  MobileServiceUser u = await mobileService.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, payload);
  </code></pre>
  
  <p><code>LoginAsync</code> is now executing, but it returns null so I still can't make calls to the tables.</p>