OfficeDev / microsoft-teams-sample-complete-node

A template for building complex bots for Microsoft Teams - Node.JS version
MIT License
127 stars 65 forks source link

Cannot run authentication scenarios #62

Open pavel-gatilov-epam opened 6 years ago

pavel-gatilov-epam commented 6 years ago

Hello,

I have gone through the instructions to set up this sample using Glitch. Overall, this went well. However, I cannot get authentication samples working.

Do I need to somehow configure the application first? Probably needs to do something like https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/auth-configure ?

AD authentication

  1. Go to the personal page of the bot
  2. Switch to 'Simple Auth' tab
  3. Click 'Login to Azure AD' or 'Login to Azure AD (V2 endpoints)'
  4. Authenticate using my work account

The log in pop up stays visible with this error: _AADSTS700051: responsetype 'token' is not enabled for the application

Silent Authentication

  1. Go to the personal page of the bot
  2. Switch to Ailent Auth' tab
  3. Wait

After some time, 'Login to Azure AD' button appears. In browser console, I can see errors (attached) teams.microsoft.com-1539620532446.log

  1. click 'Login to Azure AD'
  2. Authenticate using my work account

The log in pop up stays visible with a similar error: _AADSTS700054: response_type 'idtoken' is not enabled for the application

pavel-gatilov-epam commented 6 years ago

I have managed to get it working after the following additional steps:

  1. Went to https://apps.dev.microsoft.com
  2. Found my Bot
  3. Added a 'Web' platform
  4. Added 2 redirect URLs to web platform:
    1. https://[glitch domain]/tab-auth/simple-end
    2. https://[glitch domain]/tab-auth/silent-end
  5. Added 'User.Read' and 'User.ReadWrite' Delegated permissions
  6. Saved
mplwork commented 5 years ago

I have managed to get it working after the following additional steps:

1. Went to https://apps.dev.microsoft.com

2. Found my Bot

3. Added a 'Web' platform

4. Added 2 redirect URLs to web platform:

   1. https://[glitch domain]/tab-auth/simple-end
   2. https://[glitch domain]/tab-auth/silent-end

Yuppiiie!!! This needs to go in bold face on top of the docs! I spent two days to figure this out and was just about to open a similar issue here and found yours.

The error message is doesn't tell which url it wants registered:

Sign in

Sorry, but we’re having trouble signing you in. AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: 'abfa0a7c-a6b6-4736-8310-5855508787cd'.