Skip to content

Commit 469204c

Browse files
committed
fix: fix when creating HMAC jwts invoke #keyPair
1 parent a9f75fb commit 469204c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

simple-jwt-spring-boot-starter/src/main/java/com/onixbyte/simplejwt/autoconfiguration/AuthzeroTokenResolverAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public AuthzeroTokenResolverAutoConfiguration(SimpleJwtProperties simpleJwtPrope
9393
public TokenResolver<DecodedJWT> tokenResolver() {
9494
var builder = AuthzeroTokenResolver.builder();
9595

96-
if (TokenAlgorithm.HMAC_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
96+
if (TokenAlgorithm.ECDSA_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
9797
builder.keyPair(simpleJwtProperties.getPublicKey(), simpleJwtProperties.getPrivateKey())
9898
.algorithm(simpleJwtProperties.getAlgorithm());
99-
} else if (TokenAlgorithm.ECDSA_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
99+
} else if (TokenAlgorithm.HMAC_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
100100
builder.secret(simpleJwtProperties.getSecret())
101101
.algorithm(simpleJwtProperties.getAlgorithm());
102102
}

0 commit comments

Comments
 (0)