I'm creating a Microsoft Teams bot that will allow a user to log in with a third-party OAuth and make authenticated requests to a non-Microsoft web service. I am able to use an OAuthPrompt
to log in with my third-party OAuth provider, using a connection set up in Azure Bot Services. When I authenticate, I receive a guid which is presumably a key that corresponds to my OAuth token in the Bot Framework Token Service.
I am unclear on how to use this guid to make authenticated requests against my web service. The documentation states (emphasis mine):
To perform certain operations on behalf of a user ... the bot will need to call an external service, such as the Microsoft Graph, GitHub, or a company's REST service. Each external services has a way of securing those calls, and a common way to secure such a call is to issue those requests using a user token that uniquely identifies the user on that external service (sometimes referred to as a JWT).
This documentation indicates to me that it should be possible to use make authenticated requests to my web service via the Bot Token Framework Service or that it should be possible to retrieve my OAuth token to make authenticated requests directly to my service from my bot. I cannot find any example of anyone doing this, and have spent days looking through documentation and the botbuilder source repositories.
The bot should response to messages or actions from the user with results from the web service. For example, if a user pastes a link to a specific web page that is not available unless logged in, the bot will create a link preview of that page using the user's OAuth identity and send it to the conversation.
I am using Bot Builder v4 and the Bot Framework Emulator.