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 get authorization result with user assertion when second visiting? #34

Open ClareMu opened 8 years ago

ClareMu commented 8 years ago

Hi, In the sample code, graph API needed authorization is got from Authorization cached when logging into AAD, but AAD will cache the user logging info, which means when I visit the restAPI in the second time, I don't need to log in again, so I won't have Authorization cached, authContext.AcquireTokenSilent(graphResourceId, credential, new UserIdentifier(userObjectID, UserIdentifierType.UniqueId)); these code can not read the property authorization.

My question is, is there another way to read authorization with user assertion from context when user visit the API in second time?