Skip to content

Commit f492ade

Browse files
authored
Merge pull request #826 from govuk-one-login/OLH-4070-allow-RS512
OLH-4070: allow RS512 for signing
2 parents b2eddc0 + 7cd85b9 commit f492ade

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

solutions/api/src/lambda/token/utils/verifyClientAssertion.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("verifyClientAssertion", () => {
7777
expect(mockJwtVerify).toHaveBeenCalledWith(
7878
mockClientAssertion,
7979
expect.any(Function),
80-
{ algorithms: ["ES256", "RS256"] },
80+
{ algorithms: ["ES256", "RS256", "RS512"] },
8181
);
8282
expect(mockMetrics.addDimensions).toHaveBeenCalledWith({
8383
client_id: "test-client-id",
@@ -97,7 +97,7 @@ describe("verifyClientAssertion", () => {
9797
expect(mockJwtVerify).toHaveBeenCalledWith(
9898
mockClientAssertion,
9999
expect.any(Function),
100-
{ algorithms: ["ES256", "RS256"] },
100+
{ algorithms: ["ES256", "RS256", "RS512"] },
101101
);
102102
});
103103

@@ -111,7 +111,7 @@ describe("verifyClientAssertion", () => {
111111
expect(mockJwtVerify).toHaveBeenCalledWith(
112112
mockClientAssertion,
113113
expect.any(Function),
114-
{ algorithms: ["ES256", "RS256"] },
114+
{ algorithms: ["ES256", "RS256", "RS512"] },
115115
);
116116
});
117117

solutions/commons/utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const jarKeyEncryptionAlgorithm = "RSA-OAEP-256";
1010
export const jarContentEncryptionAlgorithm = "A256GCM";
1111

1212
export const jwtSigningAlgorithm = "ES256";
13-
export const jwtVerifyAlgorithms = ["ES256", "RS256"];
13+
export const jwtVerifyAlgorithms = ["ES256", "RS256", "RS512"];
1414

1515
export const checkUserAgentCookieName = "amc";
1616

solutions/frontend/src/handlers/authorize/utils/verifyJwt.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe("verifyJwt", () => {
119119

120120
expect(result).toStrictEqual(payload);
121121
expect(mockJwtVerify).toHaveBeenCalledWith(signedJwt, "mock-jwks", {
122-
algorithms: ["ES256", "RS256"],
122+
algorithms: ["ES256", "RS256", "RS512"],
123123
});
124124
});
125125

0 commit comments

Comments
 (0)