I'm trying to use auth0 and JWT in my Spring Boot project. I have imported these dependencies:
<dependency>
<groupId>com.auth0</groupId>
<artifactId>auth0-spring-security-api</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.8.1</version>
</dependency>
I also use JwtWebSecurityConfigurer to configure spring security.
If I use only auth0-spring-security-api, JwtWebSecurityConfigurer works correctly and checks my token. But I can't use the JWT class that is contained in java-jwt artifact.
If I import both dependencies in pom, it stops working and when Spring security checks my token, I get an error:
java.lang.NoSuchMethodError: com.auth0.jwt.interfaces.Verification.withIssuer(Ljava/lang/String;)Lcom/auth0/jwt/interfaces/Verification;
Also, I know that java-jwt library is a dependency of auth0-spring-security-api, I think that there's a sort of collision with two libraries. Does anyone have a solution? Thanks