In this blog post we will try to see what kind of user information we can access using Microsoft.IdentityModel.Clients.ActiveDirectory library. In the last post we saw how we can get access token from a native application. If you are using Active Directory client library to generate an access token for different client application you should be aware about what kind of client data you can access except the one that your application access it. AuthenticationContext authenticationContext = new AuthenticationContext(_loginUrl); AuthenticationResult result = authenticationContext.AcquireToken( "https://outlook.office365.com/", //This is resource id for Exchange Server from Office 365 "clientID", new Uri("http://localhost/")); string myCoolToken = result.AccessToken; From the start you should know that you cannot access user password. Once you get the authentication result object that contains the token itself, you will be able to access some user ...
DREAMER, CRAFTER, TECHNOLOGY ENTHUSIAST, SPEAKER, TRAINER, AZURE MVP, SOLVING HARD BUSINESS PROBLEMS WITH CUTTING-EDGE TECHNOLOGY