-
Notifications
You must be signed in to change notification settings - Fork 262
Add docs for signin/failure handling #2719
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9529664
Add docs for signin/failure handling
6de8158
Update PY note
b4ca3ac
Fix file reference
f6467d5
Update C# docs
3277259
Update with complete list of failure codes
2238f49
Apply PR feedback
a46236f
Add manifest verification line
1ad82ac
Remove 'Please contact your admin' line
a5f34d2
Fix capitalization issue for C#
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
teams.md/docs/main/teams/user-authentication/troubleshooting-sso.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| sidebar_position: 2 | ||
| title: Troubleshooting | ||
| summary: Common SSO errors and how to resolve them | ||
| --- | ||
|
|
||
| import LangLink from '@site/src/components/LangLink'; | ||
|
|
||
| # SSO Troubleshooting | ||
|
|
||
| When SSO fails, Teams sends a `signin/failure` invoke activity to your bot with a `code` and `message` describing the error. The SDK's default handler logs a warning with these details. | ||
|
|
||
| ## Failure codes | ||
|
|
||
| | Code | Silent | Description | | ||
| |------|--------|-------------| | ||
| | `installappfailed` | No | Failed to install the app in the user's personal scope (group chat SSO flow). | | ||
| | `authrequestfailed` | No | The SSO auth request failed after app installation. | | ||
| | `installedappnotfound` | Yes | The bot app is not installed for the user or group chat. *(most common)* | | ||
| | `invokeerror` | Yes | A generic error occurred during the SSO invoke flow. | | ||
| | `resourcematchfailed` | Yes | The token exchange resource URI on the OAuthCard does not match the Application ID URI in the Entra app registration's "Expose an API" section. *(common)* | | ||
| | `oauthcardnotvalid` | Yes | The bot's OAuthCard could not be parsed. | | ||
| | `tokenmissing` | Yes | AAD token acquisition failed. | | ||
|
|
||
| "Silent" failures produce no user-facing feedback in the Teams client — the user sees nothing and sign-in simply doesn't complete. "Non-silent" failures occur during the group chat SSO flow where the user is shown an install/auth card. | ||
|
|
||
| :::note | ||
| The `userconsentrequired` and `interactionrequired` codes are handled by the Teams client via the OAuth card fallback flow and do not typically reach the bot. | ||
| ::: | ||
|
|
||
| ## `resourcematchfailed` | ||
|
|
||
| If you see a warning in your app logs like: | ||
|
|
||
| > Sign-in failed for user "..." in conversation "...": resourcematchfailed -- Resource match failed | ||
|
|
||
| This means Teams attempted the SSO token exchange but failed because the token exchange resource URI does not match your Entra app registration. To fix this: | ||
|
|
||
| 1. **Verify "Expose an API"** in your Entra app registration: the Application ID URI must be set (typically `api://<Your-Application-Id>`) | ||
| 2. **Verify the `access_as_user` scope** is defined under "Expose an API" | ||
| 3. **Verify pre-authorized client applications** include the Teams Desktop (`1fec8e78-bce4-4aaf-ab1b-5451cc387264`) and Teams Web (`5e3ce6c0-2b1f-4285-8d4b-75ee78787346`) client IDs | ||
| 4. **Verify the Token Exchange URL** in your Azure Bot OAuth connection matches the Application ID URI exactly | ||
| 5. **Verify the `webApplicationInfo.resource`** in your Teams app manifest matches the Application ID URI | ||
|
|
||
| :::tip | ||
| If you don't need SSO and only want standard OAuth (sign-in button), leave the **Token Exchange URL** blank in your OAuth connection settings. | ||
| ::: | ||
|
|
||
| To handle `signin/failure` programmatically in your app, see <LangLink to="in-depth-guides/user-authentication#handling-sign-in-failures">Handling Sign-In Failures</LangLink> in the User Authentication guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.