title: Can't Login with Microsoft Account
body: <p>I am using The "PHP League oauth2-client" to get details of particular user.</p>
  
  <p>But got error : </p>
  
  <pre><code> Array
          (
              [error] =&gt; Array
                  (
                      [code] =&gt; InvalidAuthenticationToken
                      [message] =&gt; Access token validation failure. Invalid audience.
                      [innerError] =&gt; Array
                          (
                              [request-id] =&gt; &lt;reuest-id&gt;
                              [date] =&gt; 2019-06-13T07:44:01
                          )
  
                  )
  
          )
  </code></pre>
  
  <p>I have passed clientId ,clientSecret , redirectUri ,urlAuthorize , urlAccessToken , urlResourceOwnerDetails and got authorizationUrl . When I hit authorizationUrl , it properly redirect with code ,state,session_state . 
  I just use this code and got accesstoken array. 
  Using accesstoken array ,  I call '<a href="https://graph.microsoft.com/v1.0/me/" rel="nofollow noreferrer">https://graph.microsoft.com/v1.0/me/</a>'api to fetch user details. But got error i.e Access token validation failure. Invalid audience.</p>
  
  <p>Actually , I am trying login with Microsoft  </p>
  
  <pre><code>$provider = new \League\OAuth2\Client\Provider\GenericProvider([
                  'clientId'                =&gt; '&lt;cid&gt;',    // The client ID assigned to you by the provider
                  'clientSecret'            =&gt; '&lt;clientSecret&gt;',   // The client password assigned to you by the provider
                  'redirectUri'             =&gt; 'https://mywebsideurl',
                 'urlAuthorize'            =&gt; 'https://login.microsoftonline.com/&lt;tenant_id&gt;/oauth2/authorize',
                  'urlAccessToken'          =&gt; 'https://login.microsoftonline.com/&lt;tenant_id&gt;/oauth2/token',
                  'urlResourceOwnerDetails' =&gt; 'https://graph.microsoft.com/v1.0/users/&lt;my-microsoft-mail-id&gt;',
  
              ]);
  
               $accessToken = $provider-&gt;getAccessToken('authorization_code', [
                          'code' =&gt; '&lt;code&gt;'
                      ]);
  
              $request = $provider-&gt;getAuthenticatedRequest(
                          'GET',
                          'https://graph.microsoft.com/v1.0/me/',
                          $accessToken
                      );
  </code></pre>
  
  <p>Error : </p>
  
  <pre><code>Array
  (
      [error] =&gt; Array
          (
              [code] =&gt; InvalidAuthenticationToken
              [message] =&gt; Access token validation failure. Invalid audience.
              [innerError] =&gt; Array
                  (
                      [request-id] =&gt; &lt;some id&gt;
                      [date] =&gt; 2019-06-12T07:36:49
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I have parse server response :</p>
  
  <pre><code>GuzzleHttp\Psr7\Response Object
          (
              [reasonPhrase:GuzzleHttp\Psr7\Response:private] =&gt; Unauthorized
              [statusCode:GuzzleHttp\Psr7\Response:private] =&gt; 401
              [headers:GuzzleHttp\Psr7\Response:private] =&gt; Array
                  (
                      [Content-Type] =&gt; Array
                          (
                              [0] =&gt; application/json; charset=utf-8
                          )
  
                      [request-id] =&gt; Array
                          (
                              [0] =&gt; &lt;rid&gt;
                          )
  
                      [client-request-id] =&gt; Array
                          (
                              [0] =&gt; &lt;client-request-id&gt;
                          )
  
                      [x-ms-ags-diagnostic] =&gt; Array
                          (
                              [0] =&gt; {"ServerInfo":{"DataCenter":"&lt;some place name here&gt;","Slice":"SliceC","Ring":"&lt;some number&gt;","ScaleUnit":"&lt;something&gt;","RoleInstance":"something","ADSiteName":"something"}}
                          )
  
                      [WWW-Authenticate] =&gt; Array
                          (
                              [0] =&gt; Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize", client_id="&lt;some id here&gt;"
                          )
  
                      [Strict-Transport-Security] =&gt; Array
                          (
                              [0] =&gt; max-age=31536000
                          )
  
                      [Date] =&gt; Array
                          (
                              [0] =&gt; Thu, 13 Jun 2019 07:44:01 GMT
                          )
  
                      [Content-Length] =&gt; Array
                          (
                              [0] =&gt; &lt;some length&gt;
                          )
  
                  )
  
              [headerNames:GuzzleHttp\Psr7\Response:private] =&gt; Array
                  (
                      [content-type] =&gt; Content-Type
                      [request-id] =&gt; request-id
                      [client-request-id] =&gt; client-request-id
                      [x-ms-ags-diagnostic] =&gt; x-ms-ags-diagnostic
                      [www-authenticate] =&gt; WWW-Authenticate
                      [strict-transport-security] =&gt; Strict-Transport-Security
                      [date] =&gt; Date
                      [content-length] =&gt; Content-Length
                  )
  
              [protocol:GuzzleHttp\Psr7\Response:private] =&gt; 1.1
              [stream:GuzzleHttp\Psr7\Response:private] =&gt; GuzzleHttp\Psr7\Stream Object
                  (
                      [stream:GuzzleHttp\Psr7\Stream:private] =&gt; Resource id #&lt;some_id&gt;
                      [size:GuzzleHttp\Psr7\Stream:private] =&gt; &lt;some number&gt;
                      [seekable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                      [readable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                      [writable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                      [uri:GuzzleHttp\Psr7\Stream:private] =&gt; php://temp
                      [customMetadata:GuzzleHttp\Psr7\Stream:private] =&gt; Array
                          (
                          )
  
                  )
  
          ) 
  </code></pre>
  
  <blockquote>
    <p>As per my observation server return WWW-Authenticate url is wrong , it
    should be
    <a href="https://login.microsoftonline.com/tenant_id/oauth2/authorize" rel="nofollow noreferrer">https://login.microsoftonline.com/tenant_id/oauth2/authorize</a> . </p>
    
    <p>Is there any way to config WWW-Authenticate url from azure  back-end
    ??</p>
  </blockquote>