Skip to content

Commit 4bce221

Browse files
Mark WithSignedHttpRequestProofOfPossession as experimental (#5047)
shr pop exp Co-authored-by: Gladwin Johnson <[email protected]>
1 parent 0da69c9 commit 4bce221

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

src/client/Microsoft.Identity.Client/ApiConfig/AbstractConfidentialClientAcquireTokenParameterBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public T WithProofOfPossession(PoPAuthenticationConfiguration popAuthenticationC
105105
/// </remarks>
106106
public T WithSignedHttpRequestProofOfPossession(PoPAuthenticationConfiguration popAuthenticationConfiguration)
107107
{
108+
ValidateUseOfExperimentalFeature();
109+
108110
CommonParameters.PopAuthenticationConfiguration = popAuthenticationConfiguration ?? throw new ArgumentNullException(nameof(popAuthenticationConfiguration));
109111

110112
CommonParameters.AuthenticationOperation = new PopAuthenticationOperation(CommonParameters.PopAuthenticationConfiguration, ServiceBundle);

tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/PoPTests.NetFwk.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public async Task HappyPath_Async()
8080
.Create(settings.ClientId)
8181
.WithAuthority(settings.Authority)
8282
.WithClientSecret(settings.GetSecret())
83+
.WithExperimentalFeatures(true)
8384
.WithTestLogging()
8485
.Build();
8586

@@ -107,6 +108,7 @@ private async Task BearerAndPoP_CanCoexist_Async()
107108
var cca = ConfidentialClientApplicationBuilder
108109
.Create(settings.ClientId)
109110
.WithClientSecret(settings.GetSecret())
111+
.WithExperimentalFeatures(true)
110112
.WithTestLogging()
111113
.WithAuthority(settings.Authority).Build();
112114
ConfigureInMemoryCache(cca);
@@ -155,7 +157,9 @@ private async Task MultipleKeys_Async()
155157
var cca = ConfidentialClientApplicationBuilder.Create(settings.ClientId)
156158
.WithTestLogging()
157159
.WithAuthority(settings.Authority)
158-
.WithClientSecret(settings.GetSecret()).Build();
160+
.WithClientSecret(settings.GetSecret())
161+
.WithExperimentalFeatures(true)
162+
.Build();
159163
ConfigureInMemoryCache(cca);
160164

161165
var result = await cca
@@ -176,6 +180,7 @@ private async Task MultipleKeys_Async()
176180
.Create(settings.ClientId)
177181
.WithAuthority(settings.Authority)
178182
.WithClientSecret(settings.GetSecret())
183+
.WithExperimentalFeatures(true)
179184
.WithHttpClientFactory(new NoAccessHttpClientFactory()) // token should be served from the cache, no network access necessary
180185
.Build();
181186
ConfigureInMemoryCache(cca);
@@ -221,6 +226,7 @@ public async Task PopTestWithConfigObjectAsync()
221226
.Create(settings.ClientId)
222227
.WithAuthority(settings.Authority)
223228
.WithClientSecret(settings.GetSecret())
229+
.WithExperimentalFeatures(true)
224230
.WithTestLogging()
225231
.Build();
226232

@@ -257,6 +263,7 @@ public async Task PopTestWithRSAAsync()
257263
.Create(settings.ClientId)
258264
.WithAuthority(settings.Authority)
259265
.WithClientSecret(settings.GetSecret())
266+
.WithExperimentalFeatures(true)
260267
.Build();
261268

262269
//RSA provider
@@ -294,6 +301,7 @@ public async Task ROPC_PopTestWithRSAAsync()
294301
.Create(settings.ClientId)
295302
.WithAuthority(settings.Authority)
296303
.WithClientSecret(settings.GetSecret())
304+
.WithExperimentalFeatures(true)
297305
.Build();
298306

299307
//RSA provider
@@ -324,6 +332,7 @@ public async Task PopTest_ExternalWilsonSigning_Async()
324332
.Create(settings.ClientId)
325333
.WithAuthority(settings.Authority)
326334
.WithClientSecret(settings.GetSecret())
335+
.WithExperimentalFeatures(true)
327336
.Build();
328337

329338
// Create an RSA key Wilson style (SigningCredentials)
@@ -389,6 +398,7 @@ public async Task PopTestWithECDAsync()
389398
.Create(settings.ClientId)
390399
.WithAuthority(settings.Authority)
391400
.WithClientSecret(settings.GetSecret())
401+
.WithExperimentalFeatures(true)
392402
.Build();
393403

394404
//ECD Provider
@@ -520,6 +530,7 @@ public async Task InMemoryCryptoProvider_AlgIsPS256()
520530
.Create(settings.ClientId)
521531
.WithAuthority(settings.Authority)
522532
.WithClientSecret(settings.GetSecret())
533+
.WithExperimentalFeatures(true)
523534
.Build();
524535

525536
// Create a new InMemoryCryptoProvider and get its JWK
@@ -572,6 +583,7 @@ public async Task InMemoryCryptoProvider_WithGraph()
572583
.Create(settings.ClientId)
573584
.WithAuthority(settings.Authority)
574585
.WithClientSecret(settings.GetSecret())
586+
.WithExperimentalFeatures(true)
575587
.Build();
576588

577589
// Create a new InMemoryCryptoProvider and get its JWK
@@ -659,6 +671,7 @@ public async Task PoPToken_ShouldHaveCorrectAlgorithm_PS256_Async()
659671
.Create(settings.ClientId)
660672
.WithAuthority(settings.Authority)
661673
.WithClientSecret(settings.GetSecret())
674+
.WithExperimentalFeatures(true)
662675
.Build();
663676

664677
var popConfig = new PoPAuthenticationConfiguration(new Uri(ProtectedUrl))

tests/Microsoft.Identity.Test.Unit/pop/PoPTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public async Task POP_ShrValidation_Async()
5858
ConfidentialClientApplication app =
5959
ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
6060
.WithClientSecret(TestConstants.ClientSecret)
61+
.WithExperimentalFeatures(true)
6162
.WithHttpManager(httpManager)
6263
.BuildConcrete();
6364

@@ -91,6 +92,7 @@ public async Task POP_NoHttpRequest_Async()
9192
ConfidentialClientApplication app =
9293
ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
9394
.WithClientSecret(TestConstants.ClientSecret)
95+
.WithExperimentalFeatures(true)
9496
.WithHttpManager(httpManager)
9597
.BuildConcrete();
9698

@@ -128,6 +130,7 @@ public async Task POP_WithCustomNonce_Async()
128130
ConfidentialClientApplication app =
129131
ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
130132
.WithClientSecret(TestConstants.ClientSecret)
133+
.WithExperimentalFeatures(true)
131134
.WithHttpManager(httpManager)
132135
.BuildConcrete();
133136

@@ -403,6 +406,7 @@ public async Task CacheKey_Includes_POPKid_Async()
403406
ConfidentialClientApplication app =
404407
ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
405408
.WithClientSecret(TestConstants.ClientSecret)
409+
.WithExperimentalFeatures(true)
406410
.WithHttpManager(httpManager)
407411
.BuildConcrete();
408412
var testTimeService = new TestTimeService();
@@ -579,6 +583,7 @@ public async Task POP_SignatureValidationWithPS256_Async()
579583
ConfidentialClientApplication app =
580584
ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
581585
.WithClientSecret(TestConstants.ClientSecret)
586+
.WithExperimentalFeatures(true)
582587
.WithHttpManager(httpManager)
583588
.BuildConcrete();
584589

@@ -647,6 +652,7 @@ public async Task TokenGenerationAndValidation_Async()
647652
{
648653
ConfidentialClientApplication app = ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
649654
.WithClientSecret(TestConstants.ClientSecret)
655+
.WithExperimentalFeatures(true)
650656
.WithHttpManager(httpManager)
651657
.BuildConcrete();
652658

tests/Microsoft.Identity.Test.Unit/pop/PopAuthenticationOperationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public async Task ValidateKeyExpirationAsync()
114114
var app = ConfidentialClientApplicationBuilder.Create(TestConstants.ClientId)
115115
.WithHttpManager(harness.HttpManager)
116116
.WithClientSecret("some-secret")
117+
.WithExperimentalFeatures(true)
117118
.BuildConcrete();
118119

119120
TokenCacheHelper.PopulateCache(app.AppTokenCacheInternal.Accessor);

0 commit comments

Comments
 (0)