Made JwtConfigurer fluent

Adjusted return type of #decoder(JwtDecoder) and #jwkSetUri(String)
to return the JwtDecoder itself. Added new method #and() that returns
the enclosing OAuth2ResourceServerConfigurer.

Fixes gh-5595
This commit is contained in:
Daniel Meier 2018-08-07 15:41:56 +02:00 committed by Joe Grandja
parent 973af94b42
commit 14a7387190
1 changed files with 7 additions and 3 deletions

View File

@ -199,13 +199,17 @@ public final class OAuth2ResourceServerConfigurer<H extends HttpSecurityBuilder<
this.context = context;
}
public OAuth2ResourceServerConfigurer<H> decoder(JwtDecoder decoder) {
public JwtConfigurer decoder(JwtDecoder decoder) {
this.decoder = decoder;
return OAuth2ResourceServerConfigurer.this;
return this;
}
public OAuth2ResourceServerConfigurer<H> jwkSetUri(String uri) {
public JwtConfigurer jwkSetUri(String uri) {
this.decoder = new NimbusJwtDecoderJwkSupport(uri);
return this;
}
public OAuth2ResourceServerConfigurer<H> and() {
return OAuth2ResourceServerConfigurer.this;
}