Polish OAuth2AuthorizedClientArgumentResolver

This commit is contained in:
Joe Grandja 2019-11-27 12:37:47 -05:00
parent 80f256e425
commit 65513f2e3b
1 changed files with 5 additions and 7 deletions

View File

@ -137,13 +137,11 @@ public final class OAuth2AuthorizedClientArgumentResolver implements HandlerMeth
.switchIfEmpty(currentServerWebExchange()); .switchIfEmpty(currentServerWebExchange());
return Mono.zip(defaultedRegistrationId, defaultedAuthentication, defaultedExchange) return Mono.zip(defaultedRegistrationId, defaultedAuthentication, defaultedExchange)
.map(t3 -> { .map(t3 -> OAuth2AuthorizeRequest.withClientRegistrationId(t3.getT1())
OAuth2AuthorizeRequest.Builder builder = OAuth2AuthorizeRequest.withClientRegistrationId(t3.getT1()).principal(t3.getT2()); .principal(t3.getT2())
if (t3.getT3() != null) { .attribute(ServerWebExchange.class.getName(), t3.getT3())
builder.attribute(ServerWebExchange.class.getName(), t3.getT3()); .build()
} );
return builder.build();
});
} }
private Mono<Authentication> currentAuthentication() { private Mono<Authentication> currentAuthentication() {