-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
id_token 'RS256' signature verification failed, client: xxx.xxx.170.207 #72
Comments
I have got the same issue with last version (0.1.11). I can reproduce outside nginx with this sample code :
The output is : "too long" The JWT signature is validated by jwt.io. |
When I renew my keypair (RSA 2048, signing algorithm SHA-256 with RSA), JWT verification is functionnal. I don't know what the type of keypair before, it was the OpenAM 13.5 default (and don't work). |
Working fine in openresty. Used like this. local auth = <long jwt token encoded with RS256>
local jwt_obj = jwt:verify("-----BEGIN CERTIFICATE-----\nMIIC9zCCAd+gAwJWAJfmS7WKGsLMA0GCSqGSIb3DQEBCwUAMBkxFzAVBgNVBAMTDnNscGwuYXV0aDAuY29tMB4XDTE3MDMyMzE3MzAzMloXDTMwMTEzMDE3MzAzMlowGTEXMBUGA1UEAxMOc2xwbC5hdXRoMC5jb20wggEiAQUAA4IBDwAwggEKAoIBAQDc+qP5FlIJH/x1Epn3sjVVUjybYCijJzshlrzswkyasmB4X/LoNowZnVzGbw6sS6cka6sGWVp8k+TCrDD44mvcehEu5YA4u13ssUwHcwJeTPQQ8orHb8Hhekl6GfR1N0y7S9N6d63yBeY5OSdeRsTUCyxTtXGARXlSkhFuAtE+5o59LK+W8iJxHgOS8vlSiSR8blCfybKeuPG8pGo5vEialRic5FPmmywblNSREX6vBZE+A1aqRrfHkr9Y7mWv8cL6brUieluOiDP+gEk9rF62l3gCKxfKaKysimL7SBiXyBsvgG0xooQhwusUAPgpfgsQi9LpBAgMjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFOJ8K2IQkypV2KHGMIhOZfHBij/cMA4GA1UdDwEB/wQEAwIChDANBgkqhkiG9wEAZHgDrpnxbL2v9/cNTDHcmYzy1RuCnt/YARBdV++kkKFX0bizl+iA/yK1pMHHC/MWXyvVSJHfktnlY4IWTkf4ZYapYA0toLDaafqYj8Lw6eGGggs8pay/Qmvq8LR5E9iS/FJ+B3ZciI4zJlZv4Uuwuwrag==\n-----END CERTIFICATE-----\n", auth)
print('encode------' .. cjson.encode(jwt_obj) ); Token and Signing Certificate are generated by Auth0 |
My precedent comment confirm this. When the signing key is corrupt, this don't work and it's normal !! Althought the error message is not very clear, I think this issue should be closed. |
hello to all of you, @grrolland I'm indeed facing the same "too long" issue... but no way to identify what's going wrong (so far !). What do you mean by that ? Do you mean that the key obtained (for example) from the JWKS endpoint of the Identity Provider may be "corrupted" ?
Thanks for your help! |
[In complement to my previous post, as I'm still interesting in @grrolland feedbacks !] I’m using the Most of the time, everything is ok… but it happens that the JWT token verification leads to an error in the Let me explain the call stack and the analysis I made:
What I realized, is that the occurrence of the error depends on the key pair of the KeyCloak realm: with most of the key pairs I used (generated by KeyCloak at Realm creation time), everything is ok, but with some specific realms keys (but I unfortunately don’t know what is the exact specificity of these keys !! :( ), the JWT token verification always leads to an error in the I followed the processing of requests without issue (i.e. with KeyCloak keys that are not generating a JWT token validation issue!) and requests with issues: everything looks similar up to the call of the I was unfortunately not able to dump all the input data at low level, but I have the full JWT + the public key for both ok and ko use cases. Do you think this could be due to a problem in the Thanks a lot for your help. |
Ok, found ! I’ve just submitted a PR to |
I am able to validate the token at jwt.io. Signature validation is also true using my public key.
2018/01/15 06:13:11 [debug] 256#256: *78 [lua] openidc.lua:737: openidc_load_jwt_and_verify_crypto(): jwt: {"signature":"Jb9T5QlRDIJMdhcC_jQ9bZlCKuRBEWe9BJd70g0sw1UJbznKwXb46eGsaGgAF1aorsZaEQqefAxkL5rfgp9dPVETyAQrToGD74QloStLq_15oeCLa0wAeJvHGb4x_pEGNqAjLYHu04MaguQfVZsVulM80kxBLCQ7ILJvii06HuU","reason":"too long",
"reason":"too long" - what could be the reason it repeatedly shows "too long" and verification fails on nginx ?
Reference - zmartzone/lua-resty-openidc#135
The text was updated successfully, but these errors were encountered: