Azure-Samples / active-directory-dotnet-graphapi-web

A .NET 4.5 MVC web app that demonstrates how to query the Azure AD Graph API using the Azure AD Graph Client Library
82 stars 68 forks source link

'How To Run This Sample' fails with access denied #7

Closed ronnieholm closed 6 years ago

ronnieholm commented 9 years ago

Following steps 1 and 2 on how to run the web app launches the web site in the browser. Clicking any of the links (Profile, UserList, GroupList, ContactList, RoleList) results in a yellow error page:

OpenIdConnectMessage.Error was not null, indicating a possible error: 'access_denied'
Error_Description (may be empty): 'AADSTS50034: User account is not registered
for the account. 
Trace ID: 2c8b724a-d6a9-45f0-897d-41ab099961e2
Correlation ID: fa68e2a1-f466-4660-aa54-c2b2c8448912
Timestamp: 2014-08-06 10:20:21Z
sri- commented 9 years ago

Hi ronnieholm,

The error occurs if you are signing in as a user from a tenant other than the one configured in the OpenIdConnectAuthenticationOptions.

Make sure you clear your browser cookies and sign in as demoUser@graphDir1.onMicrosoft.com if you configured the app with graphDir1.onMicrosoft.com tenant.

Sri.