SaiUpadhyayula / spring-reddit-clone

Reddit clone built using Spring Boot, Spring Security with JWT Authentication, Spring Data JPA with MySQL, Spring MVC. The frontend is built using Angular - You can find the frontend source code here - https://github.com/SaiUpadhyayula/angular-reddit-clone
658 stars 386 forks source link

parser() method in jwts is deprecated #11

Closed hajimurtaza closed 3 years ago

hajimurtaza commented 3 years ago

Can you update JwtProvider.java file in security package since parser().setSigningKey() doesnt work anymore. Not able to find replacement solution for that as well.

image

fullslackdev commented 3 years ago

The code in JwtProvider.java is incorrect yes, see https://github.com/SaiUpadhyayula/spring-reddit-clone/blob/master/src/main/java/com/programming/techie/springredditclone/security/JwtProvider.java#L69 You need to change this line and any other calls to the deprecated parser() method with Jwts.parserBuilder().setSigningKey(getPublicKey()).build().parseClaimsJws(jwt);. The parserBuilder().setSigningKey(getPublicKey()).build() is the part that replaces the deprecated method call.

SaiUpadhyayula commented 3 years ago

I didn't find time to check it, I can check this weekend, meanwhile if you are interested, please feel free to raise a PR :)

SaiUpadhyayula commented 3 years ago

Issue is fixed with this PR https://github.com/SaiUpadhyayula/spring-reddit-clone/pull/16