oidc-client-js icon indicating copy to clipboard operation
oidc-client-js copied to clipboard

NetIQ IDP - "No key matching kid or alg found in signing keys" Error

Open nzdjigit opened this issue 9 years ago • 3 comments

Hi,

We are using oidc-client v1.4.1 and NetIQ as the identity provider. For some reason we are getting the "No key matching kid or alg found in signing keys" error.

We got the keys from the jwks_uri and set them in the code: [{ "kty": "RSA", "use": "sig", "alg": "RS256", "n": "AOcqBJ5O+7wT3LjRyoLn4quVr0CoLaCMDuRFNnrA+zmSXVCDJOEN4qCua/YuP4TFbjKViEsVHA3oF/mvI7Rxc8OIRDKLxyiI5z59dIQ1403BYGsm0k6VatdnzjH1KRb5SLhju5fhoMFOG+DzsdC3CujXwmEld5Xzx/Xfj3owr9QmKDyuDV+ZIxfh+gl7JSmxbanGeppx3d+ei4WroW4EFe4mQl2p4HpbzbL/DTUZ4JIHnpeTRPk5vjRPSnTDC7O5emGohYHgWzjg1K88CpPvTMLwV2nJhD0VB26keEEAjcEfF77tt3q74JT7KG/IhDRiB8YO0fGRFFSeyBTG5xR9tXU=", "e": "AQAB" }]

Any ideas on what's going wrong?

Thanks

nzdjigit avatar Nov 14 '17 04:11 nzdjigit

After looking into this a bit further we found that the ID Token contains only a single key in its header and it's "alg": "none". Safe to assume that's the reason why it can't find a matching signing key.

Not sure why the IDP is returning an ID Token with "alg": "none" though.

We'll check if that can be fixed on the IDP side, but if it can't, do you have any suggestions? Should oidc-client library just default to the first key in the list?

nzdjigit avatar Nov 14 '17 06:11 nzdjigit

If the alg is none, we don't support that. As for the error, I'd also have to track down where it is. IIRC, we support matching the kid, or if there's only one key we use that. If there are more than one, IIRC, we would prolly fail without a kid.

brockallen avatar Nov 14 '17 13:11 brockallen

Thanks Brock. We've managed to fix it up on the IDP side, 'alg' key is now coming back with RS256. So all good!

Thanks again Ken

nzdjigit avatar Nov 14 '17 22:11 nzdjigit