I have a scenario where the user can select my application in MS team. There is a command that user can select people using people picker in Adaptive card when they submit it will trigger backend API
protected async handleTeamsMessagingExtensionSubmitActionDispatch( context: TurnContext, action: MessagingExtensionAction ): Promise<MessagingExtensionActionResponse> {}
In backend it will translate the user ID from people picker into display name by calling graph API search the user by https://graph.microsoft.com/beta/users/{userId} and then create the adaptive card and insert it to compose message area.
the graph API required access token contains scope for read User.Read.All to access all user information.
My problem is in handleTeamsMessagingExtensionQuery I can call handleMessageExtensionQueryWithSSO which is part of teamsfx
await handleMessageExtensionQueryWithSSO( context, oboAuthConfig, initialLoginEndpoint, ["User.Read.All", "User.Read"], async (token: MessageExtensionTokenResponse) => {}
which return ssoToken and I can use it to get access token to call graph API but I cannot use it in the handleTeamsMessagingExtensionSubmitActionDispatch
my question is how can I get sso token in handleTeamsMessagingExtensionSubmitActionDispatch or are there any other handler that trigger before and I can get sso token
I get sso token in handleTeamsMessagingExtensionSubmitActionDispatch or are there any other handler that trigger before and I can get sso token
user25541638 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.