MoritzP
MoritzP

Reputation: 43

How to add authorization to Microsoft Teams Bot in Azure

I hosted a Bot in Azure that works as intended, but I wanted to add authorization via Azure Active Directory. I already set oauth2AllowIdTokenImplicitFlow and oauth2AllowImplicitFlow to true and checked ID-Token under authorization.

But when I go to my hosted Bots Url I still get this message:

AADSTS700054: response_type 'id_token' is not enabled for the application.

Are there better ways for authorization or am I missing something?

Thanks in advance!

Upvotes: 1

Views: 351

Answers (1)

Hilton Giesenow
Hilton Giesenow

Reputation: 10804

I'm not totally clear what you mean about "connected to SharePoint.." - do you mean the Bot calls into those products, using, say, app credentials, and that's why you want to authenticate the user? If so, you should have a look at Authentication flow for Bots as part of the Teams documentation.

Essentially, it involves sending a special kind of "card" response (if you've not send a Card, it means that, instead of sending a text message to the user, you're sending a kind of "mini form" inside the chat window). There's more on cards here, but specifically later on in the doc is a part about the card you need, the signin card.

The first article links to a second one with more detailed step-by-step instructions on getting it up and running, and getting the access token, as well as a link to a sample project. See Add authentication to your Teams bot.

Hope that helps.

Upvotes: 1

Related Questions