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

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

Best Java code snippets using org.springframework.security.config.web.server.ServerHttpSecurity$OAuth2LoginSpec.getAuthenticationManager (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$OAuth2LoginSpecgetAuthenticationManager

Javadoc

Gets the ReactiveAuthenticationManager to use. First tries an explicitly configured manager, and defaults to OAuth2AuthorizationCodeReactiveAuthenticationManager

Popular methods of ServerHttpSecurity$OAuth2LoginSpec

  • <init>
  • configure
  • createAttemptAuthenticationRequestMatcher
  • createDefault
  • getAuthenticationConverter
  • getAuthorizedClientRepository
  • getAuthorizedClientService
  • getClientRegistrationRepository
  • getLinks
  • getOauth2UserService
  • getOidcUserService
  • and
    Allows method chaining to continue configuring the ServerHttpSecurity
  • getOidcUserService,
  • and,
  • authenticationConverter,
  • authenticationManager,
  • authenticationMatcher,
  • authorizationRequestResolver,
  • getAuthenticationMatcher,
  • getRedirectWebFilter

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • Kernel (java.awt.image)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top PhpStorm 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