Skip to content

Commit 0a6063e

Browse files
authored
Merge branch 'main' into bogavril/5809
2 parents b628bb9 + fdfb876 commit 0a6063e

112 files changed

Lines changed: 1319 additions & 4932 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,24 @@ Copilot will automatically reference and describe:
4545
- `@msal-mtls-pop-guidance` - Foundational concepts
4646
- `@msal-mtls-pop-vanilla` - Direct token acquisition
4747
- `@msal-mtls-pop-fic-two-leg` - Token exchange patterns
48+
- `@msal-auth-code-flow` - Authorization Code Flow
49+
- `@msal-client-credentials` - Client Credentials Flow
50+
- `@msal-obo-flow` - On-Behalf-Of Flow
4851

4952
---
5053

5154
## 📚 Available Skills Overview
5255

53-
This repository contains **three GitHub Agent Skills** for mTLS Proof-of-Possession (PoP) authentication:
56+
This repository contains **six GitHub Agent Skills** for MSAL.NET authentication:
5457

5558
| Skill | Purpose | Best For |
5659
|-------|---------|----------|
5760
| **@msal-mtls-pop-guidance** | Foundational concepts, terminology, decision frameworks | Learning the fundamentals, comparing approaches |
5861
| **@msal-mtls-pop-vanilla** | Direct single-step token acquisition with complete code | Quick implementation with MSI or Confidential Client |
5962
| **@msal-mtls-pop-fic-two-leg** | Two-step token exchange patterns | Complex scenarios requiring token exchange |
63+
| **@msal-auth-code-flow** | Authorization Code Flow for web apps | User sign-in with server-side backend |
64+
| **@msal-client-credentials** | Client Credentials Flow for daemons | Service-to-service, no user context |
65+
| **@msal-obo-flow** | On-Behalf-Of Flow for multi-tier APIs | Propagating user identity through API chain |
6066

6167
---
6268

.github/skills/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ GitHub Copilot Agent Skills are specialized knowledge modules that help Copilot
1313

1414
## Available Skills
1515

16-
### 1. Confidential Client Authentication (`msal-confidential-auth/`)
16+
### 1. Confidential Client Authentication
1717

18-
A comprehensive skill set for confidential client authentication patterns in MSAL.NET, covering three core flows with granularized, reusable credential setup patterns.
18+
Three individual skills for confidential client authentication patterns in MSAL.NET, with reusable credential setup patterns in `msal-shared/`.
1919

2020
#### Authentication Flows
2121

22-
- **[Authorization Code Flow](msal-confidential-auth/auth-code-flow/SKILL.md)** - Web applications with user sign-in
23-
- **[On-Behalf-Of (OBO) Flow](msal-confidential-auth/obo-flow/SKILL.md)** - Multi-tier services acting on behalf of users
24-
- **[Client Credentials Flow](msal-confidential-auth/client-credentials/SKILL.md)** - Service-to-service daemon applications
22+
- **[Authorization Code Flow](msal-auth-code-flow/SKILL.md)** - Web applications with user sign-in
23+
- **[On-Behalf-Of (OBO) Flow](msal-obo-flow/SKILL.md)** - Multi-tier services acting on behalf of users
24+
- **[Client Credentials Flow](msal-client-credentials/SKILL.md)** - Service-to-service daemon applications
2525

2626
#### Shared Resources (DRY Principle)
2727

@@ -141,9 +141,9 @@ Specialized skills for mTLS PoP authentication with Managed Identity and Confide
141141

142142
| Scenario | Skill to Use |
143143
|----------|--------------|
144-
| Web app with user sign-in | [Authorization Code Flow](msal-confidential-auth/auth-code-flow/SKILL.md) |
145-
| API acting on behalf of user | [On-Behalf-Of Flow](msal-confidential-auth/obo-flow/SKILL.md) |
146-
| Daemon/background service | [Client Credentials Flow](msal-confidential-auth/client-credentials/SKILL.md) |
144+
| Web app with user sign-in | [Authorization Code Flow](msal-auth-code-flow/SKILL.md) |
145+
| API acting on behalf of user | [On-Behalf-Of Flow](msal-obo-flow/SKILL.md) |
146+
| Daemon/background service | [Client Credentials Flow](msal-client-credentials/SKILL.md) |
147147
| Direct mTLS PoP token (MSI/SNI) | [Vanilla mTLS PoP](msal-mtls-pop-vanilla/SKILL.md) |
148148
| FIC token exchange with mTLS PoP | [FIC Two-Leg mTLS PoP](msal-mtls-pop-fic-two-leg/SKILL.md) |
149149

@@ -235,11 +235,12 @@ skill-name/
235235
│ ├── code-examples/ # Copy-paste code snippets
236236
│ ├── credential-setup/ # Setup guides by credential type
237237
│ └── patterns/ # Common patterns, troubleshooting
238-
├── skill-set-name/
239-
│ ├── flow1/
240-
│ │ └── SKILL.md # Flow-specific documentation
241-
│ └── flow2/
242-
│ └── SKILL.md
238+
├── msal-auth-code-flow/
239+
│ └── SKILL.md # Auth Code Flow skill
240+
├── msal-client-credentials/
241+
│ └── SKILL.md # Client Credentials Flow skill
242+
├── msal-obo-flow/
243+
│ └── SKILL.md # OBO Flow skill
243244
└── individual-skill-name/
244245
├── SKILL.md # Main documentation with YAML frontmatter
245246
└── HelperClass.cs # Optional production helper class

.github/skills/msal-confidential-auth/auth-code-flow/SKILL.md renamed to .github/skills/msal-auth-code-flow/SKILL.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
---
2+
name: msal-auth-code-flow
3+
description: Authorization Code Flow for web applications using MSAL.NET confidential client to sign in users and access APIs on their behalf
4+
tags:
5+
- msal
6+
- auth-code
7+
- authorization-code
8+
- web-app
9+
- confidential-client
10+
- user-sign-in
11+
- redirect
12+
- consent
13+
---
14+
115
# Authorization Code Flow Skill
216

317
## Overview
@@ -20,15 +34,15 @@ Authorization Code Flow is used by web applications to authenticate users and ob
2034

2135
### Generate Code Snippet
2236
Agent can show code snippets for each credential type:
23-
- Standard Certificate: [with-certificate.cs](../../msal-shared/code-examples/with-certificate.cs)
24-
- Certificate with SNI: [with-certificate-sni.cs](../../msal-shared/code-examples/with-certificate-sni.cs)
25-
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../../msal-shared/code-examples/with-federated-identity-credentials.cs)
37+
- Standard Certificate: [with-certificate.cs](../msal-shared/code-examples/with-certificate.cs)
38+
- Certificate with SNI: [with-certificate-sni.cs](../msal-shared/code-examples/with-certificate-sni.cs)
39+
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../msal-shared/code-examples/with-federated-identity-credentials.cs)
2640

2741
### Setup Guidance
2842
Reference appropriate credential setup:
29-
- [Certificate Setup](../../msal-shared/credential-setup/certificate-setup.md)
30-
- [Certificate with SNI](../../msal-shared/credential-setup/certificate-sni-setup.md)
31-
- [Federated Identity Credentials](../../msal-shared/credential-setup/federated-identity-credentials.md)
43+
- [Certificate Setup](../msal-shared/credential-setup/certificate-setup.md)
44+
- [Certificate with SNI](../msal-shared/credential-setup/certificate-sni-setup.md)
45+
- [Federated Identity Credentials](../msal-shared/credential-setup/federated-identity-credentials.md)
3246

3347
### Example: Web Application with Certificate
3448
```csharp
@@ -54,11 +68,11 @@ public async Task HandleCallback(string code, string state)
5468
```
5569

5670
### Error Resolution
57-
Refer to [Troubleshooting Guide](../../msal-shared/patterns/troubleshooting.md)
71+
Refer to [Troubleshooting Guide](../msal-shared/patterns/troubleshooting.md)
5872

5973
### Best Practices
60-
- Use [Token Caching Strategies](../../msal-shared/patterns/token-caching-strategies.md) for optimal token acquisition
61-
- Implement [Error Handling Patterns](../../msal-shared/patterns/error-handling-patterns.md)
74+
- Use [Token Caching Strategies](../msal-shared/patterns/token-caching-strategies.md) for optimal token acquisition
75+
- Implement [Error Handling Patterns](../msal-shared/patterns/error-handling-patterns.md)
6276
- Store refresh tokens securely
6377
- Use PKCE for native clients
6478
- For advanced caching options including distributed caches for multi-instance deployments, see [Token cache serialization documentation](https://learn.microsoft.com/en-us/entra/msal/dotnet/how-to/token-cache-serialization?tabs=msal)

.github/skills/msal-confidential-auth/client-credentials/SKILL.md renamed to .github/skills/msal-client-credentials/SKILL.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
---
2+
name: msal-client-credentials
3+
description: Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement
4+
tags:
5+
- msal
6+
- client-credentials
7+
- daemon
8+
- service-to-service
9+
- confidential-client
10+
- background-service
11+
- machine-to-machine
12+
---
13+
114
# Client Credentials Flow Skill
215

316
## Overview
@@ -20,15 +33,15 @@ Client Credentials Flow is used for service-to-service authentication without us
2033

2134
### Generate Code Snippet
2235
Agent can show code for each credential type:
23-
- Standard Certificate: [with-certificate.cs](../../msal-shared/code-examples/with-certificate.cs)
24-
- Certificate with SNI: [with-certificate-sni.cs](../../msal-shared/code-examples/with-certificate-sni.cs)
25-
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../../msal-shared/code-examples/with-federated-identity-credentials.cs)
36+
- Standard Certificate: [with-certificate.cs](../msal-shared/code-examples/with-certificate.cs)
37+
- Certificate with SNI: [with-certificate-sni.cs](../msal-shared/code-examples/with-certificate-sni.cs)
38+
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../msal-shared/code-examples/with-federated-identity-credentials.cs)
2639

2740
### Setup Guidance
2841
Reference appropriate credential setup:
29-
- [Certificate Setup](../../msal-shared/credential-setup/certificate-setup.md)
30-
- [Certificate with SNI](../../msal-shared/credential-setup/certificate-sni-setup.md)
31-
- [Federated Identity Credentials](../../msal-shared/credential-setup/federated-identity-credentials.md)
42+
- [Certificate Setup](../msal-shared/credential-setup/certificate-setup.md)
43+
- [Certificate with SNI](../msal-shared/credential-setup/certificate-sni-setup.md)
44+
- [Federated Identity Credentials](../msal-shared/credential-setup/federated-identity-credentials.md)
3245

3346
### Example: Service with Certificate
3447
```csharp
@@ -60,11 +73,11 @@ public class TokenAcquisitionService
6073
```
6174

6275
### Error Resolution
63-
Refer to [Troubleshooting Guide](../../msal-shared/patterns/troubleshooting.md)
76+
Refer to [Troubleshooting Guide](../msal-shared/patterns/troubleshooting.md)
6477

6578
### Best Practices
66-
- Use [Token Caching Strategies](../../msal-shared/patterns/token-caching-strategies.md) - enable static token caching with `.WithCacheOptions(CacheOptions.EnableSharedCacheOptions)` for optimal performance
67-
- Implement [Error Handling Patterns](../../msal-shared/patterns/error-handling-patterns.md)
79+
- Use [Token Caching Strategies](../msal-shared/patterns/token-caching-strategies.md) - enable static token caching with `.WithCacheOptions(CacheOptions.EnableSharedCacheOptions)` for optimal performance
80+
- Implement [Error Handling Patterns](../msal-shared/patterns/error-handling-patterns.md)
6881
- Monitor token acquisition using `AuthenticationResultMetadata` for cache hit ratios
6982
- Rotate certificates periodically (if using certificate-based auth)
7083
- Use Federated Identity Credentials with Managed Identity for keyless authentication

.github/skills/msal-confidential-auth/obo-flow/SKILL.md renamed to .github/skills/msal-obo-flow/SKILL.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
---
2+
name: msal-obo-flow
3+
description: On-Behalf-Of (OBO) Flow for web APIs to call downstream APIs while preserving user identity in MSAL.NET
4+
tags:
5+
- msal
6+
- obo
7+
- on-behalf-of
8+
- token-exchange
9+
- confidential-client
10+
- multi-tier
11+
- downstream-api
12+
- user-assertion
13+
---
14+
115
# On-Behalf-Of (OBO) Flow Skill
216

317
## Overview
@@ -23,15 +37,15 @@ ID tokens are for authentication; access tokens are for authorization and API ac
2337

2438
### Generate Code Snippet
2539
Agent can show code for each credential type:
26-
- Standard Certificate: [with-certificate.cs](../../msal-shared/code-examples/with-certificate.cs)
27-
- Certificate with SNI: [with-certificate-sni.cs](../../msal-shared/code-examples/with-certificate-sni.cs)
28-
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../../msal-shared/code-examples/with-federated-identity-credentials.cs)
40+
- Standard Certificate: [with-certificate.cs](../msal-shared/code-examples/with-certificate.cs)
41+
- Certificate with SNI: [with-certificate-sni.cs](../msal-shared/code-examples/with-certificate-sni.cs)
42+
- Federated Identity Credentials: [with-federated-identity-credentials.cs](../msal-shared/code-examples/with-federated-identity-credentials.cs)
2943

3044
### Setup Guidance
3145
Reference appropriate credential setup:
32-
- [Certificate Setup](../../msal-shared/credential-setup/certificate-setup.md)
33-
- [Certificate with SNI](../../msal-shared/credential-setup/certificate-sni-setup.md)
34-
- [Federated Identity Credentials](../../msal-shared/credential-setup/federated-identity-credentials.md)
46+
- [Certificate Setup](../msal-shared/credential-setup/certificate-setup.md)
47+
- [Certificate with SNI](../msal-shared/credential-setup/certificate-sni-setup.md)
48+
- [Federated Identity Credentials](../msal-shared/credential-setup/federated-identity-credentials.md)
3549

3650
### Example: Web API with Certificate
3751
```csharp
@@ -64,15 +78,15 @@ public async Task<IActionResult> GetData()
6478
```
6579

6680
### Error Resolution
67-
Refer to [Troubleshooting Guide](../../msal-shared/patterns/troubleshooting.md)
81+
Refer to [Troubleshooting Guide](../msal-shared/patterns/troubleshooting.md)
6882

6983
**Common OBO errors:**
7084
- `MsalUiRequiredException`: MFA or conditional access required—requires client re-authentication
7185
- Invalid token: Verify access token (not ID token) is passed
7286

7387
### Best Practices
74-
- Use [Token Caching Strategies](../../msal-shared/patterns/token-caching-strategies.md) for optimal session-based token caching
75-
- Implement [Error Handling Patterns](../../msal-shared/patterns/error-handling-patterns.md)
88+
- Use [Token Caching Strategies](../msal-shared/patterns/token-caching-strategies.md) for optimal session-based token caching
89+
- Implement [Error Handling Patterns](../msal-shared/patterns/error-handling-patterns.md)
7690
- Always validate incoming token before using in OBO
7791
- Extract `tid` claim from user token for guest user scenarios—use tenant-specific authority, not /common
7892
- For multi-instance deployments and advanced caching, see [Token cache serialization documentation](https://learn.microsoft.com/en-us/entra/msal/dotnet/how-to/token-cache-serialization?tabs=msal)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ This release expands extensibility for confidential-client authentication (certi
8383

8484
### Bug Fixes
8585
* Updated the ConfidentialClientApplication's ROPC API to add WithSendX5C() during authentication requests.[#5637](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/5637)
86+
* Removed HTTP response headers from `MsalException.ToString()` to avoid logging STS cookies (these are non-critical). [#5641](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/5641)
8687

8788
4.80.0
8889
======

LibsAndSamples.sdk.slnf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"tests/CacheCompat/CommonCache.Test.MsalV3/CommonCache.Test.MsalV3.csproj",
1313
"tests/CacheCompat/CommonCache.Test.MsalJava/CommonCache.Test.MsalJava.csproj",
1414
"tests/CacheCompat/CommonCache.Test.Common/CommonCache.Test.Common.csproj",
15-
"tests/devapps/Managed Identity apps/MSIHelperService/MSIHelperService.csproj",
1615
"tests/devapps/Managed Identity apps/ManagedIdentityAppVM/ManagedIdentityAppVM.csproj",
1716
"tests/devapps/Managed Identity apps/ManagedIdentityWebApi/ManagedIdentityWebApi.csproj",
1817
"tests/devapps/Managed Identity apps/ManagedIdentityTokenRevocation/ManagedIdentityTokenRevocation.csproj",

0 commit comments

Comments
 (0)