Codota Logo
ServerHttpSecurity$OAuth2LoginSpec.getRedirectWebFilter
Code IndexAdd Codota to your IDE (free)

How to use
getRedirectWebFilter
method
in
org.springframework.security.config.web.server.ServerHttpSecurity$OAuth2LoginSpec

Best Java code snippets using org.springframework.security.config.web.server.ServerHttpSecurity$OAuth2LoginSpec.getRedirectWebFilter (Showing top 1 results out of 315)

  • Common ways to obtain ServerHttpSecurity$OAuth2LoginSpec
private void myMethod () {
ServerHttpSecurity$OAuth2LoginSpec s =
  • Codota Iconnew OAuth2LoginSpec()
  • Codota IconServerHttpSecurity serverHttpSecurity;serverHttpSecurity.oauth2Login()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-security

protected void configure(ServerHttpSecurity http) {
  ReactiveClientRegistrationRepository clientRegistrationRepository = getClientRegistrationRepository();
  ServerOAuth2AuthorizedClientRepository authorizedClientRepository = getAuthorizedClientRepository();
  OAuth2AuthorizationRequestRedirectWebFilter oauthRedirectFilter = getRedirectWebFilter();
  ReactiveAuthenticationManager manager = getAuthenticationManager();
  AuthenticationWebFilter authenticationFilter = new OAuth2LoginAuthenticationWebFilter(manager, authorizedClientRepository);
  authenticationFilter.setRequiresAuthenticationMatcher(getAuthenticationMatcher());
  authenticationFilter.setServerAuthenticationConverter(getAuthenticationConverter(clientRegistrationRepository));
  RedirectServerAuthenticationSuccessHandler redirectHandler = new RedirectServerAuthenticationSuccessHandler();
  authenticationFilter.setAuthenticationSuccessHandler(redirectHandler);
  authenticationFilter.setAuthenticationFailureHandler(new ServerAuthenticationFailureHandler() {
    @Override
    public Mono<Void> onAuthenticationFailure(WebFilterExchange webFilterExchange,
        AuthenticationException exception) {
      return Mono.error(exception);
    }
  });
  authenticationFilter.setSecurityContextRepository(new WebSessionServerSecurityContextRepository());
  MediaTypeServerWebExchangeMatcher htmlMatcher = new MediaTypeServerWebExchangeMatcher(
      MediaType.TEXT_HTML);
  htmlMatcher.setIgnoredMediaTypes(Collections.singleton(MediaType.ALL));
  Map<String, String> urlToText = http.oauth2Login.getLinks();
  if (urlToText.size() == 1) {
    http.defaultEntryPoints.add(new DelegateEntry(htmlMatcher, new RedirectServerAuthenticationEntryPoint(urlToText.keySet().iterator().next())));
  } else {
    http.defaultEntryPoints.add(new DelegateEntry(htmlMatcher, new RedirectServerAuthenticationEntryPoint("/login")));
  }
  http.addFilterAt(oauthRedirectFilter, SecurityWebFiltersOrder.HTTP_BASIC);
  http.addFilterAt(authenticationFilter, SecurityWebFiltersOrder.AUTHENTICATION);
}
org.springframework.security.config.web.serverServerHttpSecurity$OAuth2LoginSpecgetRedirectWebFilter

Popular methods of ServerHttpSecurity$OAuth2LoginSpec

  • <init>
  • configure
  • createAttemptAuthenticationRequestMatcher
  • createDefault
  • getAuthenticationConverter
  • getAuthenticationManager
    Gets the ReactiveAuthenticationManager to use. First tries an explicitly configured manager, and def
  • getAuthorizedClientRepository
  • getAuthorizedClientService
  • getClientRegistrationRepository
  • getLinks
  • getOauth2UserService
  • getOidcUserService
  • getOauth2UserService,
  • getOidcUserService,
  • and,
  • authenticationConverter,
  • authenticationManager,
  • authenticationMatcher,
  • authorizationRequestResolver,
  • getAuthenticationMatcher

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now