user4888365
user4888365

Reputation: 21

Access denied to the specified API version in Azure AD Graph Client 2.0

I have a registered Web project in Azure with the following permissions to other applications: Windows Azure Active Directory - Read Directory Data - Enable sign-on and read users' profiles

I copied the clientId, tenantId and secret. I'm generating a token as in this example: https://github.com/AzureADSamples/ConsoleApp-GraphAPI-DotNet/blob/8c779dd4c6976fe384f9e731e7952bd985415373/GraphConsoleAppV3/AuthenticationHelper.cs

After creating an instance of the ActiveDirectoryClient when retrieving users I get an exception.

Retrieve users:

 activeDirectoryClient.Users.ExecuteAsync().Result.CurrentPage.ToList();

Exception details:

InnerException: "Access denied to the specified API version."

Message: "One or more errors occurred."

Source: "mscorlib"

Data: {System.Collections.ListDictionaryInternal}

HelpLink: null

HResult: -2146233088

How can the application have access to the new api?

Upvotes: 1

Views: 495

Answers (1)

user4888365
user4888365

Reputation: 21

I uninstalled and installed again the GraphClient nugget package, and after that I stop seeing the exception.

Upvotes: 1

Related Questions