Skip to content

Add confidential client troubleshooting guide#760

Open
neha-bhargava wants to merge 1 commit into
livefrom
docs/confidential-client-troubleshooting
Open

Add confidential client troubleshooting guide#760
neha-bhargava wants to merge 1 commit into
livefrom
docs/confidential-client-troubleshooting

Conversation

@neha-bhargava

Copy link
Copy Markdown
Contributor

Summary

Adds a new troubleshooting page for confidential client applications under Advanced > Handling exceptions and errors.

Topics covered

  • Throttling (HTTP 429 / AADSTS50196) — detecting cache misses, respecting Retry-After
  • Network instability and socket exceptions — token caching as primary mitigation, HttpClient guidance
  • On-Behalf-Of (OBO) failures — AADSTS50013, consent issues, token size
  • Client credential errors — invalid secret (AADSTS7000215), expired cert (AADSTS700024), app not found (AADSTS700016)
  • Token cache miss diagnosis — CacheRefreshReason table, distributed cache verification
  • Managed Identity failures — IMDS timeout, federated identity credential mismatch

Motivation

These scenarios were identified as gaps in the existing MSAL.NET documentation. The current exception/error handling docs focus primarily on public client (desktop/mobile) flows. This page provides equivalent guidance for service-to-service scenarios that are common in production workloads.

Changes

  • \msal-dotnet-articles/advanced/exceptions/confidential-client-troubleshooting.md\ — new page
  • \msal-dotnet-articles/TOC.yml\ — added TOC entry under 'Handling exceptions and errors'

New page covering common issues in confidential client apps:
- Throttling (HTTP 429 / AADSTS50196)
- Network instability and socket exceptions
- On-Behalf-Of (OBO) failures
- Client credential errors (invalid secret, expired cert, app not found)
- Token cache miss diagnosis
- Managed Identity failures

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@neha-bhargava neha-bhargava requested a review from a team as a code owner May 19, 2026 18:54
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit b9d6304:

✅ Validation status: passed

File Status Preview URL Details
msal-dotnet-articles/advanced/exceptions/confidential-client-troubleshooting.md ✅Succeeded View
msal-dotnet-articles/TOC.yml ✅Succeeded View

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.


Verify if there are any recent updates to network or firewall rules that might have caused connectivity issues to `login.microsoftonline.com` and regional endpoints.

## On-Behalf-Of (OBO) failures

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are also cases where a UiRequiredException is thrown and the user needs to handle conditional access by satisfying the provided access policies in the claims.

See MsalUiRequiredException

@trwalke trwalke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should handle claims challenge for conditional access. otherwise LGTM


`MsalServiceException` with `AADSTS7000215: Invalid client secret provided`.

#### Resolution

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that we wanted to move away from client secrets due to security. Should probable add a comment here encouraging customers to use certs or some other auth method.


#### Symptoms

`MsalServiceException` with error code `AADSTS50013: Assertion failed signature validation` or `invalid_grant`.

@bgavrilMS bgavrilMS May 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth stating that apps should not try to extract the AADSTS error codes and to handle these dynamically. The codes are just references.

The exception types are sufficient for dynamic processing, e.g. UiRequiredException - need to reprompt the user, ClaimsExcepton - need to add claims.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants