title: AADSTS70001: Application is not supported for this API version
body: <p>I have an ASP.NET MVC web application that will need to check if a user is member of a specific group in an Azure Active Directory. To achieve this I will use Microsoft Graph API, so I downloaded their example to try it out from <a href="https://developer.microsoft.com/en-us/graph/graph/quick-start" rel="nofollow noreferrer">here</a> and got it running fine.</p>
  
  <p>My next step is to get it running with my own AppId, AppSecret and RedirectUri and this is where I get in trouble. In Azure I went to "App registrations" for the AAD and assured that the application was added. I opened the app and copied the "Application ID" for the AppId, created a key and used it as the AppSecret. I checked all the permissions and pressed "Grant Permissions" and added my URL to the Reply URLs. I also changed the Authority attribute from <a href="https://login.microsoftonline.com/common/v2.0" rel="nofollow noreferrer">https://login.microsoftonline.com/common/v2.0</a> to <a href="https://login.windows.net/xxxxxx.onmicrosoft.com" rel="nofollow noreferrer">https://login.windows.net/xxxxxx.onmicrosoft.com</a>.</p>
  
  <p>When I run the application and press "Sign in" I will come to the login screen correctly, but it will crash when I try to sign in. The crash occurs when running AcquireTokenByAuthorizationCodeAsync in the code below:</p>
  
  <pre><code>                    AuthorizationCodeReceived = async (context) =&gt;
                      {
                          var code = context.Code;
                          string signedInUserID = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value;
                          ConfidentialClientApplication cca = new ConfidentialClientApplication(
                              appId, 
                              redirectUri,
                              new ClientCredential(appSecret),
                              new SessionTokenCache(signedInUserID, context.OwinContext.Environment["System.Web.HttpContextBase"] as HttpContextBase));
                          string[] scopes = graphScopes.Split(new char[] { ' ' });
  
                          AuthenticationResult result = await cca.AcquireTokenByAuthorizationCodeAsync(scopes, code);
                      },
                      AuthenticationFailed = (context) =&gt;
                      {
                          context.HandleResponse();
                          context.Response.Redirect("/Error?message=" + context.Exception.Message);
                          return Task.FromResult(0);
                      }
  </code></pre>
  
  <p>The error message I get in AuthenticationFailed looks like this:</p>
  
  <p>AADSTS70001: Application 'xxxxxxxx-4f81-4508-8dcb-df5b94f2290f' is not supported for this API version. Trace ID: xxxxxxxx-d04c-4793-ad14-868810f00c00 Correlation ID: xxxxxxxx-ab83-4805-baea-8f590991ec0c Timestamp: 2017-06-13 10:43:08Z</p>
  
  <p>Can someone explain to me what the error message means? Should I try a different version? I have tried with both Microsoft.Graph v1.3.0 / Microsoft.Graph.Core v1.4.0 and Microsoft.Graph v1.4.0 / Microsoft.Graph.Core v1.5.0.</p>