private ServerAuthenticationEntryPoint getAuthenticationEntryPoint() { if (this.authenticationEntryPoint != null || this.defaultEntryPoints.isEmpty()) { return this.authenticationEntryPoint; } if (this.defaultEntryPoints.size() == 1) { return this.defaultEntryPoints.get(0).getEntryPoint(); } DelegatingServerAuthenticationEntryPoint result = new DelegatingServerAuthenticationEntryPoint(this.defaultEntryPoints); result.setDefaultEntryPoint(this.defaultEntryPoints.get(this.defaultEntryPoints.size() - 1).getEntryPoint()); return result; }
private ServerAuthenticationEntryPoint getAuthenticationEntryPoint() { if (this.authenticationEntryPoint != null || this.defaultEntryPoints.isEmpty()) { return this.authenticationEntryPoint; } if (this.defaultEntryPoints.size() == 1) { return this.defaultEntryPoints.get(0).getEntryPoint(); } DelegatingServerAuthenticationEntryPoint result = new DelegatingServerAuthenticationEntryPoint(this.defaultEntryPoints); result.setDefaultEntryPoint(this.defaultEntryPoints.get(this.defaultEntryPoints.size() - 1).getEntryPoint()); return result; }
private ServerAuthenticationEntryPoint getAuthenticationEntryPoint() { if (this.authenticationEntryPoint != null || this.defaultEntryPoints.isEmpty()) { return this.authenticationEntryPoint; } if (this.defaultEntryPoints.size() == 1) { return this.defaultEntryPoints.get(0).getEntryPoint(); } DelegatingServerAuthenticationEntryPoint result = new DelegatingServerAuthenticationEntryPoint(this.defaultEntryPoints); result.setDefaultEntryPoint(this.defaultEntryPoints.get(this.defaultEntryPoints.size() - 1).getEntryPoint()); return result; }
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) { return Flux.fromIterable(this.entryPoints) .filterWhen( entry -> isMatch(exchange, entry)) .next() .map( entry -> entry.getEntryPoint()) .defaultIfEmpty(this.defaultEntryPoint) .flatMap( entryPoint -> entryPoint.commence(exchange, e)); }