oAuth not working in Teams

%3CLINGO-SUB%20id%3D%22lingo-sub-3356135%22%20slang%3D%22en-US%22%3EoAuth%20not%20working%20in%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3356135%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20currently%20trying%20to%20figure%20out%20why%20oAuth%20has%20stopped%20working%20for%20our%20Bot%20in%20Teams.%26nbsp%3B%20We%20went%20back%20to%20the%20javascript_nodejs%20botbuilder-sample%2046.teams-auth%20and%20deployed%20the%20code%20to%20a%20custom%20Bot%20in%20our%20Tenant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20Web%20Chat%2C%20the%20sample%20is%20working.%26nbsp%3B%20We%20get%20a%20welcome%20message%20and%20the%20oAuth%20card%20when%20we%20type%20in%20'hi'.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_0-1652256305013.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370686iFBD644406E822914%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_0-1652256305013.png%22%20alt%3D%22voonsionglum_0-1652256305013.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EClicking%20on%20%22Sign%20In%22%20opens%20a%20new%20tab%20on%20the%20browser%2C%20where%20we%20were%20asked%20to%20login%20and%20then%20grant%20consent.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_1-1652256408754.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370687iBA0BDD0170BAED4F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_1-1652256408754.png%22%20alt%3D%22voonsionglum_1-1652256408754.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20we%20click%20on%20Allow%2C%20we%20are%20presented%20a%20validation%20code%2C%20which%20we%20can%20enter%20in%20the%20Web%20Chat%20and%20get%20a%20successful%20sign%20in.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_2-1652256458049.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370688i09E19AECDBF33061%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_2-1652256458049.png%22%20alt%3D%22voonsionglum_2-1652256458049.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_3-1652259368157.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370696iD14D8538845EE9F1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_3-1652259368157.png%22%20alt%3D%22voonsionglum_3-1652259368157.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20Teams%2C%20however%2C%20we%20get%20the%20oAuth%20prompt%20card%2C%20but%20the%20SignIn%20button%20gives%20the%20following%20error%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_4-1652259429598.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370697iD408349D526A8FC3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_4-1652259429598.png%22%20alt%3D%22voonsionglum_4-1652259429598.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fbot-service%2Fbot-builder-authentication%3Fview%3Dazure-bot-service-4.0%26amp%3Btabs%3Duserassigned%252Caadv2%252Ccsharp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fbot-service%2Fbot-builder-authentication%3Fview%3Dazure-bot-service-4.0%26amp%3Btabs%3Duserassigned%252Caadv2%252Ccsharp%20%3C%2FA%3Eand%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fauthentication%2Fadd-authentication%3Ftabs%3Ddotnet%252Cdotnet-sample%2C%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fauthentication%2Fadd-authentication%3Ftabs%3Ddotnet%252Cdotnet-sample%2C%3C%2FA%3E%26nbsp%3Bit%20is%20said%20that%20the%20%22Sign%20In%22%20button%20won't%20work%20if%20the%20related%20Teams%20App%20Manifest%20does%20not%20have%20token.botframework.com%20in%20validDomains%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_5-1652259558900.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370699iE45C2751BCFD9881%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_5-1652259558900.png%22%20alt%3D%22voonsionglum_5-1652259558900.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20our%20manifest%20is%20already%20carrying%20the%20required%20value.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22voonsionglum_6-1652259606926.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370700i31573B0B4ECD529B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22voonsionglum_6-1652259606926.png%22%20alt%3D%22voonsionglum_6-1652259606926.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20also%20seen%20the%20techcommunity%20post%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fteams-developer%2Fin-which-scenario-quot-webapplicationinfo-quot-nad-quot%2Fm-p%2F3262237%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fteams-developer%2Fin-which-scenario-quot-webapplicationinfo-quot-nad-quot%2Fm-p%2F3262237%3C%2FA%3E%26nbsp%3Bwhere%20oAuth%20is%20working%20without%20validDomains%20being%20configured.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20any%20idea%20why%20oAuth%20is%20not%20working%20for%20us%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20You%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3356135%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3357316%22%20slang%3D%22en-US%22%3ERe%3A%20oAuth%20not%20working%20in%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3357316%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F493333%22%20target%3D%22_blank%22%3E%40voonsionglum%3C%2FA%3E-We%20are%20looking%20into%20this%20I%20will%20get%20back%20to%20you%20soon.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3362070%22%20slang%3D%22en-US%22%3ERe%3A%20oAuth%20not%20working%20in%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3362070%22%20slang%3D%22en-US%22%3EThank%20You!%20I%20retested%20our%20app%20in%20Teams%20again%20today.%20Surprisingly%2C%20the%20Sign%20In%20button%20is%20now%20working%20on%20both%20Teams%20Web%20and%20Teams%20Desktop.%20I%20am%20starting%20to%20wonder%20if%20Teams%20require%20a%20%22refresh%22%20period%20to%20take%20the%20configured%20validDomains%20into%20account.%20Similar%20to%20the%20%22Please%20allow%2030%20minutes%20for%20changes%20to%20bot%20settings%20to%20be%20reflected%20in%20all%20regions.%20Changes%20to%20icons%20may%20take%20up%20to%2024%20hours.%22%20message%20we%20get%20when%20we%20try%20to%20update%20the%20Bot%20profile%20in%20Azure%2C%20maybe%20the%20manifest's%20validDomains%20configuration%20also%20require%20time%20for%20the%20settings%20to%20kick-in%3F%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20would%20be%20great%20if%20we%20can%20get%20confirmation%20from%20Microsoft.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3363689%22%20slang%3D%22en-US%22%3ERe%3A%20oAuth%20not%20working%20in%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3363689%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F493333%22%20target%3D%22_blank%22%3E%40voonsionglum%3C%2FA%3E-%20Glad%20to%20hear%20that%20your%20issue%20is%20resolved.%20We%20have%20asked%20engineering%20team%20for%20confirmation.%20We%20will%20update%20you.%3C%2FLINGO-BODY%3E
Contributor

Hi,

 

We are currently trying to figure out why oAuth has stopped working for our Bot in Teams.  We went back to the javascript_nodejs botbuilder-sample 46.teams-auth and deployed the code to a custom Bot in our Tenant.

 

In Web Chat, the sample is working.  We get a welcome message and the oAuth card when we type in 'hi'.

voonsionglum_0-1652256305013.png

 

Clicking on "Sign In" opens a new tab on the browser, where we were asked to login and then grant consent.

voonsionglum_1-1652256408754.png

 

Once we click on Allow, we are presented a validation code, which we can enter in the Web Chat and get a successful sign in.

voonsionglum_2-1652256458049.png

 

voonsionglum_3-1652259368157.png

In Teams, however, we get the oAuth prompt card, but the SignIn button gives the following error

voonsionglum_4-1652259429598.png

 

Based on https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service...and https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/add-authenticati... it is said that the "Sign In" button won't work if the related Teams App Manifest does not have token.botframework.com in validDomains

voonsionglum_5-1652259558900.png

 

However, our manifest is already carrying the required value.

voonsionglum_6-1652259606926.png

 

We have also seen the techcommunity post at https://techcommunity.microsoft.com/t5/teams-developer/in-which-scenario-quot-webapplicationinfo-quo... where oAuth is working without validDomains being configured.  

 

Does anyone have any idea why oAuth is not working for us?

 

Thank You

 

3 Replies
@voonsionglum-We are looking into this I will get back to you soon.
Thank You! I retested our app in Teams again today. Surprisingly, the Sign In button is now working on both Teams Web and Teams Desktop. I am starting to wonder if Teams require a "refresh" period to take the configured validDomains into account. Similar to the "Please allow 30 minutes for changes to bot settings to be reflected in all regions. Changes to icons may take up to 24 hours." message we get when we try to update the Bot profile in Azure, maybe the manifest's validDomains configuration also require time for the settings to kick-in?

It would be great if we can get confirmation from Microsoft.
@voonsionglum- Glad to hear that your issue is resolved. We have asked engineering team for confirmation. We will update you.