Skip to content

Commit a663466

Browse files
committed
add a test function that handles an id_token with a non-existing kid
Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
1 parent f1e5b76 commit a663466

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/spec/id_token_validation_spec.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,22 @@ describe("when the id token signature key isn't part of the JWK", function()
219219
end)
220220
end)
221221

222+
describe("when the id token signature key id isn't part of the key id's in the JWKs", function()
223+
test_support.start_server({
224+
token_header = {
225+
kid = "dcab",
226+
}
227+
})
228+
teardown(test_support.stop_server)
229+
local _, status = test_support.login()
230+
it("login has failed", function()
231+
assert.are.equals(401, status)
232+
end)
233+
it("an error message has been logged", function()
234+
assert.error_log_contains("RSA key with id dcab not found")
235+
end)
236+
end)
237+
222238
describe("when the id token signature uses a symmetric algorithm", function()
223239
test_support.start_server({
224240
jwt_sign_secret = "client_secret",

0 commit comments

Comments
 (0)