diff --git a/src/Plugin/OpenIDConnectClient/WindowsAad.php b/src/Plugin/OpenIDConnectClient/WindowsAad.php
index 6836a86..4c9f4d4 100644
--- a/src/Plugin/OpenIDConnectClient/WindowsAad.php
+++ b/src/Plugin/OpenIDConnectClient/WindowsAad.php
@@ -136,7 +136,11 @@ class WindowsAad extends OpenIDConnectClientBase {
       '#default_value' => !empty($this->configuration['hide_email_address_warning']) ? $this->configuration['hide_email_address_warning'] : '',
       '#description' => $this->t('By default, when email address is not found, a message will appear on the screen. This option hides that message (as it might be confusing for end users).'),
     ];
-
+    $form['use_v2'] = [
+      '#title' => $this->t('Enable v2.0'),
+      '#type' => 'checkbox',
+      '#default_value' => !empty($this->configuration['use_v2']) ? $this->configuration['use_v2'] : 0,
+    ];
     return $form;
   }
 
@@ -211,7 +215,7 @@ class WindowsAad extends OpenIDConnectClientBase {
       // Expected result.
       $tokens = [
         'id_token' => $response_data['id_token'],
-        'access_token' => $response_data['access_token'],
+        'access_token' => ($this->configuration['use_v2'] == 1) ? $response_data['id_token'] : $response_data['access_token'],
         'refresh_token' => isset($response_data['refresh_token']) ? $response_data['refresh_token'] : FALSE,
       ];
       if (array_key_exists('expires_in', $response_data)) {
@@ -245,7 +249,7 @@ class WindowsAad extends OpenIDConnectClientBase {
     // affect the data we collect and use in the Userinfo array.
     switch ($this->configuration['userinfo_graph_api_wa']) {
       case 1:
-        $userinfo = $this->buildUserinfo($access_token, 'https://graph.windows.net/me?api-version=1.6', 'userPrincipalName', 'displayName');
+        $userinfo = $this->buildUserinfo($access_token, 'https://graph.windows.net/me?api-version=1.6', 'userPrincipalName', 'name');
         break;
 
       case 2:
@@ -308,8 +312,8 @@ class WindowsAad extends OpenIDConnectClientBase {
       $profile_data = json_decode($response_data, TRUE);
       $profile_data['name'] = $profile_data[$name];
 
-      // Azure provides 'mail' for userinfo vs email.
-      if (!isset($profile_data['mail'])) {
+      // Azure provides 'mail' for userinfo vs email only for v1.
+      if (!$this->configuration['use_v2'] && !isset($profile_data['email'])) {
         // See if we have the Graph otherMails property and use it if available,
         // if not, add the principal name as email instead, so Drupal still will
         // create the user anyway.
@@ -319,6 +323,10 @@ class WindowsAad extends OpenIDConnectClientBase {
             $profile_data['email'] = current($profile_data['otherMails']);
           }
         }
+        // use_v2
+        if ($profile_data['emails']) {
+          $profile_data['email'] = reset($profile_data['emails']);
+        }
         else {
           // Show message to user.
           if ($this->configuration['hide_email_address_warning'] <> 1) {
