-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
404 Not found when trying to use Teams SSO to get the user token #6625
Comments
I'm having the same problem when using the Emulator, the sample codes are not working because the GetToken endpoint is returning Not Found, so it is asking for authentication on every turn. |
We are seeing the same issue, any pointers on what can be done to mitigate this? |
@sandeepvootoori I got it fixed by asking the users to use the bot for the first time via the new teams client. The old client was the culprit |
We are having the same problem. Got any progress update? |
@brnowakowski not had any more information from Microsoft, they said they were 'tracking' it but yea I guess nothing will happen. You need to make sure people are logged out and use the new teams client to do the authentication first. |
We seem to have the same problem. We use the following code to get access token and the tokenResponse is sometimes null: We have noticed that the code above calls the following endpoint: https://api.botframework.com/api/usertoken/GetToken?userId=29%........&connectionName=OAuthBotSettings&channelId=msteams&code= There is clearly problem with that endpoint, which never returns any specific response with 404 status code explaining what specifically was not found: user/conversation, connection or something else. Logging in new teams client (web) does not solve the problem in my case. |
@Aspyryan see if this comment by me solves your issue, some IdP deny the request if the client is marked as confidential (aka should use client secrets). The problem is Azure Portal requires you to type in a secret, but it is not sent in the request. In other words, IdP expects client secret but the Token Service doesn't send it. The solution is to DISABLE confidential clients when using Bot Framework OAuth2. IMHO this library has not been receiving the attention it deserves. A lot of issues are ignored. |
Version
SDK Platform: C#
SDK Version: Bot Builder 4.21.0
Active Channels: Teams
Deployment Environment: Azure Bot Service
Describe the bug
404 NOT FOUND when trying to GET the user token from teams with this request:
https://api.botframework.com/api/usertoken/GetToken?userId={user-id}&connectionName=BotOAuth&channelId=msteams
When using my own id I can get a token, but my colleagues cannot, when I send them a link to "test connection" from the Azure Bot page, they can get their token perfectly fine.
Expected behavior
It should return 200 with a token, just what happens with my user-id or return a prompt to allow access?
Additional
I am using the
AdapterWithErrorHandler : CloudAdapter
withbase.Use(new TeamsSSOTokenExchangeMiddleware(storage, configuration["ConnectionName"]));
and the main code can be found below. The tokenResponse is null due to the internal request getting a 404 NOT FOUND response.Azure config:
![image](https://private-user-images.githubusercontent.com/52763578/287743690-c4a646de-63cd-4567-a8c4-80b0f94497bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NTUyNTQsIm5iZiI6MTcyNTU1NDk1NCwicGF0aCI6Ii81Mjc2MzU3OC8yODc3NDM2OTAtYzRhNjQ2ZGUtNjNjZC00NTY3LWE4YzQtODBiMGY5NDQ5N2JmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA1VDE2NDkxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlY2QxOTRlNzVjNjVhOTUyYTc3NWQzMWRmYmQ2NzNlODFmNTkwZGJlMWIwMWM5Mjc1NTVmNjE2ODU3ZTcxMDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iUQz-HmK4ODEy9nmSqwv_SyNv0qndO9gGQWCIy6pE8c)
The text was updated successfully, but these errors were encountered: