Tabnine Logo
ServerHttpSecurity$OAuth2LoginSpec.getLinks
Code IndexAdd Tabnine to your IDE (free)

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

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

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);
}
origin: org.springframework.security/spring-security-config

protected void configure(ServerHttpSecurity http) {
  ReactiveClientRegistrationRepository clientRegistrationRepository = getClientRegistrationRepository();
  ServerOAuth2AuthorizedClientRepository authorizedClientRepository = getAuthorizedClientRepository();
  OAuth2AuthorizationRequestRedirectWebFilter oauthRedirectFilter = new OAuth2AuthorizationRequestRedirectWebFilter(clientRegistrationRepository);
  ReactiveAuthenticationManager manager = getAuthenticationManager();
  AuthenticationWebFilter authenticationFilter = new OAuth2LoginAuthenticationWebFilter(manager, authorizedClientRepository);
  authenticationFilter.setRequiresAuthenticationMatcher(createAttemptAuthenticationRequestMatcher());
  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);
}
origin: apache/servicemix-bundles

protected void configure(ServerHttpSecurity http) {
  ReactiveClientRegistrationRepository clientRegistrationRepository = getClientRegistrationRepository();
  ServerOAuth2AuthorizedClientRepository authorizedClientRepository = getAuthorizedClientRepository();
  OAuth2AuthorizationRequestRedirectWebFilter oauthRedirectFilter = new OAuth2AuthorizationRequestRedirectWebFilter(clientRegistrationRepository);
  ReactiveAuthenticationManager manager = getAuthenticationManager();
  AuthenticationWebFilter authenticationFilter = new OAuth2LoginAuthenticationWebFilter(manager, authorizedClientRepository);
  authenticationFilter.setRequiresAuthenticationMatcher(createAttemptAuthenticationRequestMatcher());
  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$OAuth2LoginSpecgetLinks

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
  • getOauth2UserService
  • getOidcUserService
  • and
    Allows method chaining to continue configuring the ServerHttpSecurity
  • getOidcUserService,
  • and,
  • authenticationConverter,
  • authenticationManager,
  • authenticationMatcher,
  • authorizationRequestResolver,
  • getAuthenticationMatcher,
  • getRedirectWebFilter

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JCheckBox (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now