diff --git a/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoder.java b/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoder.java index 814d5ff06a..5b6a974fd2 100644 --- a/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoder.java +++ b/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoder.java @@ -52,6 +52,7 @@ import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidatorResult; +import org.springframework.security.oauth2.jose.jws.JwsAlgorithm; import org.springframework.security.oauth2.jose.jws.MacAlgorithm; import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm; import org.springframework.util.Assert; @@ -221,12 +222,12 @@ public final class NimbusJwtDecoder implements JwtDecoder { * Use the given signing * algorithm. * - * @param signatureAlgorithm the algorithm to use + * @param jwsAlgorithm the algorithm to use * @return a {@link JwkSetUriJwtDecoderBuilder} for further configurations */ - public JwkSetUriJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) { - Assert.notNull(signatureAlgorithm, "signatureAlgorithm cannot be null"); - this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName()); + public JwkSetUriJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) { + Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null"); + this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName()); return this; } diff --git a/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusReactiveJwtDecoder.java b/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusReactiveJwtDecoder.java index 1faf5e295d..2679085111 100644 --- a/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusReactiveJwtDecoder.java +++ b/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusReactiveJwtDecoder.java @@ -245,12 +245,12 @@ public final class NimbusReactiveJwtDecoder implements ReactiveJwtDecoder { * Use the given signing * algorithm. * - * @param signatureAlgorithm the algorithm to use + * @param jwsAlgorithm the algorithm to use * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations */ - public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) { - Assert.notNull(signatureAlgorithm, "sig cannot be null"); - this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName()); + public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) { + Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null"); + this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName()); return this; }