title: LoginAsync using Access Token and MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory
body: <p>I'm getting a "You do not have permission to view this directory or page." error when I try to <code>LoginAsync</code> with an access token and <code>MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory</code>. This works with the equivalent form with <code>MobileServiceAuthenticationProvider.MicrosoftAccount</code>. I'm not sure why this isn't working. Is there a configuration I'm missing?</p>
  
  <pre><code>var msaProvider = await WebAuthenticationCoreManager.FindAccountProviderAsync(
  "https://login.microsoft.com",
  "https://login.microsoftonline.com/3dd13bb9-5d0d-dd2e-9d1e-7a966131bf85");
  string clientId = "6d15468d-9dbe-4270-8d06-a540dab3252f";
  WebTokenRequest request1 = new WebTokenRequest(msaProvider, "User.Read", clientId);
  request1.Properties.Add("resource", "https://graph.microsoft.com");
  WebTokenRequestResult result =
  await WebAuthenticationCoreManager.RequestTokenAsync(request1);
      if (result.ResponseStatus == WebTokenRequestStatus.Success)
      {
          var token = result.ResponseData[0].Token;
          var token1 = new JObject
                  {
                      { "access_token", token }
                  };
          var user = await App.mobileServiceClient.LoginAsync(
              MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, token1);
  </code></pre>