Update JWTToklen in JWTAuthHandlerTest
Describe the Bug
The token is currently expired and causing test failures
Steps to Reproduce
- Run this test
Expected Behavior
The test should be passing
Okay, what I've found so far:
Copying the two comment blocks into files and then running
npx jwt-gen-cli -f /tmp/payload.json -e 5y -a none -s /tmp/secret.json
after deleting the "exp": 1786822616, from the payload.json
However, this just pushes the problem "down the line" as eventually our tests will break again. This leaves me with two considerations:
- Freeze the test time somewhere in the past, so that the valid tokens never expire
- Push the expiration dates on valid token like 15 years into the future and also link to this issue with instructions
Another thing that the exception is: com.auth0.jwt.exceptions.TokenExpiredException: The Token has expired on 2025-01-13T11:16:38Z. So why were the tests passing until pretty much exactly 10 months later?
Also the token named NO_ALG_PRESENT_JWT uses the RS256 apparently even from a real system because there is mention of https://sts.windows.net/8ebe249d-8312-4ffb-9b6b-08e56669d578/ as the idp
Okay, jwt-gen-cli just doesn't support JWK, so it's not parsing the JSON to retrieve the private key components. Maybe this needs to be a little Java programm that consumes the JWK and uses the private key portions of it to create a new valid token
@vringar PTAL whether this fixes your issue: https://github.com/camunda/connectors/pull/5830
The tests are passing again, so closing this for now