-
Notifications
You must be signed in to change notification settings - Fork 901
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
JwtService get all claims #70
Comments
Hi @DevRuibin , You are indeed right. I have rebuild this repository in a proper manner and added coding standards to it, you can find the repository here: The private <T> T extractClaim(String jwt, Function<Claims, T> claimsResolver) {
try {
return claimsResolver.apply(extractAllClaims(jwt));
} catch (SignatureException e) {
log.error("Invalid signature: " + e.getMessage());
} catch (MalformedJwtException e) {
log.error("Malformed JWT: " + e.getMessage());
} catch (ExpiredJwtException e) {
log.error("Expired JWT: " + e.getMessage());
} catch (UnsupportedJwtException e) {
log.error("Unsupported JWT: " + e.getMessage());
}
return null;
} I am currently building a frontend in Next.js 14, which will be committed in the coming week. |
para las personas que lo quieran en español
|
Please be informed that the translation i18n implementation is completed in repository: https://github.com/spring-boot-react/full-stack-spring-boot-security-jwt-postgresql-docker-nextjs By adding another resource bundle within the resources > i18n folder, you are able to add messages in your preferred language.
Please do let me know what you think of the implementation. |
The method
extractAllClaims
includes methodparseSignedClaims
which will throw exception if the token has expired. There is another function to check if the token has expired. it will return true if it doesn't expire. For other claims we want to extract, it doesn't work unless the token doesn't expire. I think this is not so correct in the scenario where I just need to extract claims without checking if it is valid or not.The text was updated successfully, but these errors were encountered: