-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy the dpop-nonce http header case insensitivity fix from OidcClient to AccessTokenManagement. Add tests of dpop-nonce casing in both libraries.
- Loading branch information
1 parent
300b91b
commit b5ded95
Showing
4 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
24 changes: 24 additions & 0 deletions
24
access-token-management/test/AccessTokenManagement.Tests/DPoPExtensionTests.cs
This file contains 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,24 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
namespace Duende.AccessTokenManagement.Tests; | ||
|
||
public class DPoPExtensionTests | ||
{ | ||
[Theory] | ||
[InlineData("DPoP-Nonce")] | ||
[InlineData("dpop-nonce")] | ||
[InlineData("DPOP-NONCE")] | ||
public void GetDPoPNonceIsCaseInsensitive(string headerName) | ||
{ | ||
var expected = "expected-server-nonce"; | ||
var message = new HttpResponseMessage() | ||
{ | ||
Headers = | ||
{ | ||
{ headerName, expected } | ||
} | ||
}; | ||
message.GetDPoPNonce().ShouldBe(expected); | ||
} | ||
} |
This file contains 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
26 changes: 26 additions & 0 deletions
26
identity-model-oidc-client/test/IdentityModel.OidcClient.Tests/DPoPExtensionTests.cs
This file contains 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,26 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
using Duende.IdentityModel.OidcClient.DPoP; | ||
|
||
namespace Duende.IdentityModel.OidcClient; | ||
|
||
public class DPoPExtensionTests | ||
{ | ||
[Theory] | ||
[InlineData("DPoP-Nonce")] | ||
[InlineData("dpop-nonce")] | ||
[InlineData("DPOP-NONCE")] | ||
public void GetDPoPNonceIsCaseInsensitive(string headerName) | ||
{ | ||
var expected = "expected-server-nonce"; | ||
var message = new HttpResponseMessage() | ||
{ | ||
Headers = | ||
{ | ||
{ headerName, expected } | ||
} | ||
}; | ||
message.GetDPoPNonce().ShouldBe(expected); | ||
} | ||
} |