1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 08:33:48 +00:00

fix(auth-validator): [PM-22975] Client Version Validator - Fixed more tests. Checking in with CI to see how it's looking.

This commit is contained in:
Patrick Pimentel
2025-12-02 16:13:26 -05:00
parent ed89cf8161
commit 6696104e9d
4 changed files with 26 additions and 7 deletions

View File

@@ -630,11 +630,6 @@ public class IdentityServerSsoTests
.Returns(Task.FromResult(true));
});
// Compute PKCE S256 code challenge explicitly (base64url of SHA256)
var challengeBytes = System.Text.Encoding.ASCII.GetBytes(challenge);
var hash = System.Security.Cryptography.SHA256.HashData(challengeBytes);
var codeChallenge = Duende.IdentityModel.Base64Url.Encode(hash);
var authorizationCode = new AuthorizationCode
{
ClientId = "web",
@@ -642,8 +637,8 @@ public class IdentityServerSsoTests
Lifetime = (int)TimeSpan.FromMinutes(5).TotalSeconds,
RedirectUri = "https://localhost:8080/sso-connector.html",
RequestedScopes = ["api", "offline_access"],
CodeChallenge = codeChallenge,
CodeChallengeMethod = "S256",
CodeChallenge = challenge.Sha256(),
CodeChallengeMethod = "plain",
Subject = null!, // Temporarily set it to null
};