How to get Authenticated User Email address through Azure Ad , I am using bot framework , C# and for authentication i am using AuthBot .
@matvelloso @msftgits PLEASE HELP!
Is there any way to get the user email id , as we are getting the user username using the AuthBot. @matvelloso
the from.id should be the email address and the from.name should be the name from the sender field of the email, getting information from active directory is probably an exercise with this api https://graph.microsoft.io/en-us/
Yes but that might not be reliable information depending on the channel. What you really want is to rely on the token from the AuthBot to find that information. Look at how we read the authresult here: https://github.com/MicrosoftDX/AuthBot/blob/master/AuthBot/Dialogs/AzureAuthDialog.cs#L44 and then get the username here: https://github.com/MicrosoftDX/AuthBot/blob/master/AuthBot/Dialogs/AzureAuthDialog.cs#L52
Basically all that info is in the token returned. If you take the token and isolate the value between the first "." and the last ".", what's in there is a Base64 encoded JSON. If you base64 decode it, you will see all this data, name , e-mail, etc. Beyond that, you can also request a token for the graph like Tom said and ask for additional info, like who manages who, etc.
More on that discussed here: https://github.com/MicrosoftDX/AuthBot/issues/2
Even this help me . Really thanks a lot