Revert "Nimbus JWK Set Configs Take SignatureAlgorithm"

This reverts commit 9617ff60542d91d63bf6e2713300392a920c0b54.
This commit is contained in:
Josh Cummings 2019-08-16 17:33:09 -06:00
parent 9617ff6054
commit efe8205985
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
2 changed files with 9 additions and 8 deletions

View File

@ -52,6 +52,7 @@ import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator;
import org.springframework.security.oauth2.core.OAuth2TokenValidatorResult; 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.MacAlgorithm;
import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm; import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -221,12 +222,12 @@ public final class NimbusJwtDecoder implements JwtDecoder {
* Use the given signing * Use the given signing
* <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>. * <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>.
* *
* @param signatureAlgorithm the algorithm to use * @param jwsAlgorithm the algorithm to use
* @return a {@link JwkSetUriJwtDecoderBuilder} for further configurations * @return a {@link JwkSetUriJwtDecoderBuilder} for further configurations
*/ */
public JwkSetUriJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) { public JwkSetUriJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) {
Assert.notNull(signatureAlgorithm, "signatureAlgorithm cannot be null"); Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null");
this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName()); this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName());
return this; return this;
} }

View File

@ -245,12 +245,12 @@ public final class NimbusReactiveJwtDecoder implements ReactiveJwtDecoder {
* Use the given signing * Use the given signing
* <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>. * <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>.
* *
* @param signatureAlgorithm the algorithm to use * @param jwsAlgorithm the algorithm to use
* @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
*/ */
public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) { public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) {
Assert.notNull(signatureAlgorithm, "sig cannot be null"); Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null");
this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName()); this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName());
return this; return this;
} }