-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Multiple errors when running b.oauth-bot #2030
Comments
For error 2, do you have multi-tenant selected for your bot *and app registration on azure portal? |
Yes. I edited the issue with screenshots. |
Hey @Benjiiim -- did you by any chance do any of the SSO steps manually? I ran the sample myself and was able to get error point 1 working for me: If you're using TTK and start with no bot id or other data filled out in the
For error point 2, my only suggestion is to verify that your bot is multi-tenant via the following UI in Azure Portal: Originally I asked you about the app registration, but the sample didn't create one in my case. This is what my bot configuration page looks like: Lastly, as in the readme, please ensure that you have the |
Thanks for your help. I'm using the sample without any customization. I just extract the sample folder from the 1.4.1 release zip package and run the local Teams Toolkit env in Visual Studio Code. I tried as well with the 1.4.0 release zip package just in case with same results. Regarding the first issue, I was able to see in the Azure Bot Service portal (on the channels page) that some "Internal errors" were happening with the Teams channel.
Regarding the comment about the consent prompt being declined, the consent prompt didn't appear at all in my case. I finally found how to solve the issue: delete the browser cache (I was using Teams on Edge). Sign out and sign in back was not enough. Regarding the second issue, multi-tenant is indeed activated in the bot. I sent the live manifest screenshot above and the settings is well reflected as "any org" in the Authentication page as you screenshot shows. May I ask you if you have been able to run the sample in a multi-tenant scenario by sideloading the zip package with a user account in an other tenant to give it a try? Does it work for you? |
I spoke with one of my teammates and your first issue regarding the consent prompt is a known issue. We have already alerted the Teams client team of it and filed an internal bug. Right now, the only workaround is exactly what you did with refreshing the cache of the app. Until Teams client fixes the issue, there isn't any other guidance we can provide. Yes, I did try loading the app in a separate tenant and the app worked without issues. |
Thanks again for your time and for these insights @corinagum, very appreciated. Good to know that the root cause of the first issue is identified. I spent some time on the second issue today (multitenancy). To make the b.oauth-bot sample work, we need to fix the azurebot.bicep file.
From my understanding, without this configuration, the bot service will be created as single tenant for some reasons (default value was supposed to be multitenant as they have added singletenant and UserAssignedMSI later - microsoft/botbuilder-js#3906). I'm not submitting a PR with this change as I would prefer to have your thoughts first, on various things:
|
You might discard my previous message as I'm actually not able to make the sample work in a multi-tenant configuration event with msaAppType: 'MultiTenant' for the Azure bot resource. 😓 |
I'm now starting to wonder if both errors are not related in some ways. When granting admin consent manually, which means skipping the bot consent dialog for the user, authentication works great, in both cases:
App Registrations and Bot provisioning/config look good (100% automatic through the Teams Toolkit workflow from the sample, I've just tried to add msaAppType: 'MultiTenant' for the bot resource but that doesn't seem to have any impact after all) and authentification works great as soon as the consent has been done. I've deployed the sample more than 12 times in the past few days, in two different home tenants. I can reproduce 100% of the time. Hopefully everything will be fixed when the Teams client issue you have identified a few weeks ago will be fixed but in the meantime, I'm starting to loose my hairs... Thoughts would be appreciated. |
Thanks a lot again for your time. That's really appreciated. Regarding your comments on the samples, I do understand. I was thinking out loud when talking about Managed Identity. :-) I would indeed be very interested to have your teams's thoughts about the relation between the adapter ConfigurationServiceClientCredentialFactoryOptions.MicrosoftAppType and the Azure bot resource msaAppType used during the creation of the bot service. From my perspective, they are two different things. A third thing being the AzureADMultipleOrgs value for the signInAudience property in the Entra ID app registration and a fourth being the fact that we use "common" value for the Tenant Id in the OAuth connection. 😅 When nothing is provided in the ARM/Bicep file, we don't have the field at all in the UI (see your own screenshot above). I'm wondering if this is only a cosmetic difference or if there is more... Great to know regarding the Teams client fix. I really hope that it will fix both consent dialog issues I'm having with the sample (and with the real app I'm building actually). Granting admin consent in order not to rely on the consent dialog in the user flow is a workaround not the solution. Thanks again |
Language
Javascript/Typescript
Version
latest (1.4.1)
Description
I'm running to two errors when trying to run the b.oauth-bot sample, once sending a message to the bot and expecting the consent prompt to appear.
The second error appears in a multi-tenant scenario where the Teams app is running in an other Entra ID/M365 tenant than the one used for App Registration.
Reproduction Steps
Regarding Error 2.
In the Entra ID App Registration manifest on the Entra ID Portal, I can see the signInAudience set to AzureADMultipleOrgs:
In the Bot configuration on the Azure portal, I can see that the Tenant ID is configured with common.
The text was updated successfully, but these errors were encountered: