-
Notifications
You must be signed in to change notification settings - Fork 150
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
bug: Unexpected JWT token generated by usage of TokenRequest class #1661
Comments
If you set alg to Sounds like keys in jks does not have certificate or certificate refers to algorithms which are not what SignatureAlgorithm recognizes. (In this particular case re:
Indeed fallback to HS with asymetric key does not make sense. So correct algorithm should solve problem. (Check certificate algorithm or take it out of keyId or simply add configuration property ). I will open improvement ticket on jans (trying to minimize impact on client code in 4.x ). |
key seems fine: |
hardcoding the alg works, yes
the key id is a parameter in the scim client API and the keystore contains a mix of keys that use different algorithms. Are you suggesting the use of a mechanism other than |
From kid |
@jgomer2001 I checked same scim issue few days ago. I find that signature verification not works with xyz_enc_rsa1_5 keys. As result this led to random scim test suite failures. |
It's not exactly the same issue, however in both cases scim tests are going to fail. Here I was complaining why algorithm identification not always working. It's a public method in oxauth-model that is not only used by oxauth itself but potentially in other projects. Ofc signature verification is a more critical problem. I can update docs so scim developers pick a kid ending in |
@jgomer2001 attach or PM me jks file and password to that file. I will check. |
This is pretty interesting but it sounds as we can't trust UI. I suspect it has hard-codes and does not show to us real value. Since java 11 algorithm is set to However we can do it by algorithm parameters stored as DER-encoded bytes in certificate. I've looked to implementation of some jwt libraries open sourced on github and think that I can solve it. Stay tuned :). |
Issue is fixed in 4.4, master and jans. |
When trying to figure out why scim tests are all failing in 4.4 I concluded there are some things off in certain underlying oxAuth classes that scim client employs.
In this call, the algorithm is being set to
null
. I checked the actual key in the keystore. It exists and has the following attributes:id: 90161505-78e2-4927-9239-80ac1defbef2_sig_ps256
algorithm: RSA
size: 2048
Later when the assertion is extracted from the
tokenRequest
, this method assumes the alg is HS256 (is that assumption fine?). This provokes an NPE here, which simply logs the error and continues returning a JWT without signature.I confirmed this by checking the HTTP request generated by
tokenService.requestJwtAuthorizationRpt
inUmaScimClient
. It looks this way:So the resulting (non sense) header is:
Note how
client_assertion
parameter ends with.
(dot).Extra details:
The text was updated successfully, but these errors were encountered: