MicrosoftDX / AuthBot

General authentication/authorization Bot Framework sample
MIT License
82 stars 54 forks source link

How do I get Tenant User information like (department name, company etc.) after successful login. #3

Closed manish-chitre closed 7 years ago

manish-chitre commented 8 years ago

Hello AuthBot Team,

I have followed all the instructions given in the description of the project. I am able to sign in using specific credentials of a User in Tenant and AuthBot is returning me a name. But I have a scenario in which I want to get the department name, company, last name , firstname etc from the authbot. Is there any way to do so? Thanks in Advance.

duckwaffle commented 8 years ago

Hi mate, the access token that gets created as a result of the login process can be used with the Microsoft Graph API - https://graph.microsoft.io/ . You can get info like that straight from the graph if you create an authenticated graph client after calling the IBotContext.GetAccessToken extension method in AuthBot.

See the following for more info on working with the Graph API, https://github.com/Azure-Samples/active-directory-dotnet-graphapi-web