soteria icon indicating copy to clipboard operation
soteria copied to clipboard

Throw orginal exception instead of doing nothing

Open hantsy opened this issue 3 years ago • 0 comments

When trying to get auth0, I clone this project and add some debug info the following piece in the https://github.com/eclipse-ee4j/soteria/blob/master/impl/src/main/java/org/glassfish/soteria/mechanisms/openid/domain/AccessTokenImpl.java#L63, it always failed, but there is no helpful error message.

try {
    this.tokenJWT = JWTParser.parse(token);
    jwtClaimsSet = tokenJWT.getJWTClaimsSet();
    this.claims = jwtClaimsSet.getClaims();
} catch (ParseException ex) {
    // Access token doesn't need to be JWT at all
}

I tried to change catch clause to catch (Throwable ex), and printed the exception stack, and finally found the reason of failure of Auth0, the Jwks reading was always timeout on my machine.

I add a jwksReadTimeout = 5000 to override the default value(500) to make Auth0 works.

For me, obviously print the original exception help me to determine the root cause of failure.

hantsy avatar Oct 02 '22 05:10 hantsy