Nimbus JWK Set Configs Take SignatureAlgorithm
Fixes gh-7270
This commit is contained in:
parent
9d63c36f93
commit
9617ff6054
|
@ -52,7 +52,6 @@ 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;
|
||||
|
@ -222,12 +221,12 @@ public final class NimbusJwtDecoder implements JwtDecoder {
|
|||
* Use the given signing
|
||||
* <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>.
|
||||
*
|
||||
* @param jwsAlgorithm the algorithm to use
|
||||
* @param signatureAlgorithm the algorithm to use
|
||||
* @return a {@link JwkSetUriJwtDecoderBuilder} for further configurations
|
||||
*/
|
||||
public JwkSetUriJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) {
|
||||
Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null");
|
||||
this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName());
|
||||
public JwkSetUriJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) {
|
||||
Assert.notNull(signatureAlgorithm, "signatureAlgorithm cannot be null");
|
||||
this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -245,12 +245,12 @@ public final class NimbusReactiveJwtDecoder implements ReactiveJwtDecoder {
|
|||
* Use the given signing
|
||||
* <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1" target="_blank">algorithm</a>.
|
||||
*
|
||||
* @param jwsAlgorithm the algorithm to use
|
||||
* @param signatureAlgorithm the algorithm to use
|
||||
* @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
|
||||
*/
|
||||
public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) {
|
||||
Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null");
|
||||
this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName());
|
||||
public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) {
|
||||
Assert.notNull(signatureAlgorithm, "sig cannot be null");
|
||||
this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue