opened
emecas
username_0
I am getting the following error when building using an old version of Java8 (JDK 1.8.0_112)

@username_2 has indicated [here](https://github.com/eclipse/microprofile-jwt-auth/issues/227#issuecomment-742862081) that PS256 is not a required algorithm to support for MP-JWT 1.2 and only RS256, ES256 are required signature algorithms.

```
[ERROR] Tests run: 24, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.274 s <<< FAILURE! - in io.smallrye.jwt.build.JwtSignTest
[ERROR] testSignClaimsPS256(io.smallrye.jwt.build.JwtSignTest)  Time elapsed: 0.008 s  <<< ERROR!
io.smallrye.jwt.build.JwtSignatureException: SRJWT05012: Failure to create a signed JWT token: PS256 is an unknown, unsupported or unavailable alg algorithm (not one of [none, HS256, HS384, HS512, ES256, ES384, ES512, RS256, RS384, RS512]).
        at io.smallrye.jwt.build.JwtSignTest.testSignClaimsPS256(JwtSignTest.java:431)
Caused by: org.jose4j.lang.InvalidAlgorithmException: PS256 is an unknown, unsupported or unavailable alg algorithm (not one of [none, HS256, HS384, HS512, ES256, ES384, ES512, RS256, RS384, RS512]).
        at io.smallrye.jwt.build.JwtSignTest.testSignClaimsPS256(JwtSignTest.java:431)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   JwtSignTest.testSignClaimsPS256:431 » JwtSignature SRJWT05012: Failure to crea...
[INFO]
[ERROR] Tests run: 58, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for SmallRye: MicroProfile JWT Parent 3.0.0-RC1:
[INFO]
[INFO] SmallRye: MicroProfile JWT Parent .................. SUCCESS [  8.091 s]
[INFO] SmallRye: MicroProfile JWT - Implementation Parent . SUCCESS [  1.384 s]
[INFO] SmallRye: MicroProfile JWT Implementation Common ... SUCCESS [  8.242 s]
[INFO] SmallRye: MicroProfile JWT Build Implementation .... FAILURE [ 10.138 s]
[INFO] SmallRye: MicroProfile JWT Implementation .......... SKIPPED
[INFO] SmallRye: MicroProfile JWT - Testsuite Parent ...... SKIPPED
[INFO] SmallRye: MicroProfile JWT Basic Testsuite ......... SKIPPED
[INFO] SmallRye: MicroProfile JWT TCK ..................... SKIPPED
[INFO] Empty Release Project to Avoid Maven Bug ........... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
```
[3.0.0-RC1] PS256 is not a required algorithm to support for MP-JWT 1.2 while building with old JDK8
issue
created
radcortez
username_1
Can you try with a more recent JDK 8 update?
comment
created
sberyozkin
username_2
@username_0 this particular test is not related to MP JWT 1.2 for all Java versions and we do not set the expectations that it will work for all the Java 8 versions around :-). What is your expectation around this test ?
comment
created
sberyozkin
username_2
I'd like to avoid starting checking Java 8 update versions but also see why this failing test, due to the fact TCK tests are skipped, may cause some confusions. I think I'll just make it optional going forward - check if the related signature algorithm can be loaded and only then run the test
comment
created
sberyozkin
username_2
Hi @username_0 I've removed `for MP-JWT 1.2 ` part from the subject, otheriwise it can read as if the requirement varies depending on the Java 8 version
comment
created
sberyozkin
username_2
@username_0 I should further clarify, this test is only related to a JWT builder API which is currently not part of MP JWT, but as I said I'll make this test optional anyway...
comment
created
emecas
username_0
My original expectation was just testing and passing the build locally with my existent configuration. 

Then once noticed the particular issue, my expectation moved to figuring out the why and fixing it in a dependencies level or prerequisites.

Once validated that the only difference respect to the GitHub checks was the minor version of the `JDK8` and after your clarification related to `PS256` as not a required algorithm, as well as the build passed with newer `JDK8` version and apparently with any `JDK11`

Finally, my expectation evolved towards providing (or at least helping on providing) a fix by updating the test from being required to behave as an optional check (un-related to MP-JWT 1.2) depending of the build's context (when using an old JDK8) and algorithm availability.

In conclusion, thank you @username_2 for following up this subject and all provided clarifications,  as it seems you are already working on it, please let me know if I can help
comment
created
sberyozkin
username_2
@username_0 OK, I see, thanks, see #348 - that will make things clearer, so as you can see there, if we can determine that Java supports the `PS256` natively (with the name recognized by Java) then we run the test as is else we install BC.
So even with the older Java8 it should work.
It is unrelated to MP JWT but the test itself will become more robust :-)
comment
closed
sberyozkin
username_2
issue