I am developing a Microsoft Teams messaging extension with action command and wanted to get the info on the person logged in and try to get his email address to verify on our server if he is authorized to access this or not. The context object only returns the AADObjectID which is not very useful but the email can be used to authorize them. In order to get the email I got to know that I have to make a call to TeamsInfo object and use member info API on it. Although using the api gives me "The bot is not part of the conversation roster" error. Looking into it i realized that i might only be able to call it because you can't really install a messaging extension alone. Is there a way my messaging extension can get the email of the logged in person without asking them to login again because they already are logged in into Teams?
Asked
Active
Viewed 184 times
1
-
Please take a look at [Identify User in Message Extension](https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/add-authentication#identify-the-user). Let me know if you face any issue – Trinetra-MSFT Nov 28 '19 at 04:04
-
HI @Trinetra-MSFT, This only gives me aadobjectid which is not very much useful. I am looking for user's email address. Is there a way i can get it? – Akshat G Nov 28 '19 at 16:04
-
could you please share some piece of code what you are trying? – Trinetra-MSFT Nov 29 '19 at 05:33
-
Can you explain why AadObjectId is 'not useful'? Email address can potentially change (e.g. if user changes name after getting married), or company changes the domain portion following a rebranding exercise - I'd argue that AadObjectId is much BETTER than email, in fact. – Hilton Giesenow Oct 29 '20 at 17:14
1 Answers
0
So apparently if you want to call methods in TeamsInfo class you need to have a bot and messaging extension both configured together. If you only have messaging extension it won't work.

Akshat G
- 214
- 2
- 14
-
A message extension is usually hosted in a bot anyway, so not clear why this is an issue? – Hilton Giesenow Oct 29 '20 at 17:12