-
I want to validate an access token I receive in a request, but it fails with Example: {:ok, client_context} = Oidcc.ClientContext.from_configuration_worker(Gateway.OidccConfigProvider, "client-id", "client-secret")
Oidcc.Token.validate_jwt(access_token, client_context, %{
signing_algs:
client_context.provider_configuration.token_endpoint_auth_signing_alg_values_supported
})
# Fails with {:error,
{:no_matching_key_with_kid, "zgeOJ-OVB1Ewd6M5nSDjftW7uXjJkxq17dWaPo7z420"}} Yet when I inspect the JWK set in the configuration with #JOSE.JWK<
keys: {:jose_jwk_set,
[
{:jose_jwk, :undefined,
{:jose_jwk_kty_rsa,
{:RSAPublicKey, snip, 65537}},
%{
"alg" => "RS256",
"kid" => "zgeOJ-OVB1Ewd6M5nSDjftW7uXjJkxq17dWaPo7z420",
"use" => "sig",
"x5c" => ["snip"],
"x5t" => "91MQNZV0Z1N-6TyBShUyUl1rrzo",
"x5t#S256" => "Cr5db1sZskJFmCiQdcwsgU4CFZ5v6ZY5ueF2FfvEv10"
}}
]}, Why is it failing, what am I missing? Basically I'd like to replicate the flow described at https://stackoverflow.com/a/71183948 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hm, the verification code is a bit unclear here since the errors aren't handled nicely by our JWT library. Can you add some debug statements to the following lines so that we can see with what reason it is failing? Line 355 in ef11cc3 Something like this: error:Reason ->
erlang:display(Reason),
{error, {no_matching_key_with_kid, Kid}} |
Beta Was this translation helpful? Give feedback.
@1player Awesome that you found it! I’m still happy that you reported it. The errors you were getting in this case are wrong.
I’ll open an issue to improve that.