Java 类org.springframework.security.web.AuthenticationEntryPoint 实例源码

项目:autopivot    文件:SecurityConfig.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    final Filter corsFilter = context.getBean(ICorsFilterConfig.class).corsFilter();
    final AuthenticationEntryPoint basicAuthenticationEntryPoint = context.getBean(
            BASIC_AUTH_BEAN_NAME,
            AuthenticationEntryPoint.class);
    http
            .antMatcher(JwtRestServiceConfig.REST_API_URL_PREFIX + "/**")
            // As of Spring Security 4.0, CSRF protection is enabled by default.
            .csrf().disable()
            // Configure CORS
            .addFilterBefore(corsFilter, SecurityContextPersistenceFilter.class)
            .authorizeRequests()
            .antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
            .antMatchers("/**").hasAnyAuthority(ROLE_USER)
            .and()
            .httpBasic().authenticationEntryPoint(basicAuthenticationEntryPoint);
}
项目:springuni-particles    文件:SecurityConfigurationSupport.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
  AuthenticationEntryPoint authenticationEntryPoint = lookup("authenticationEntryPoint");

  http.csrf().disable()
      .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint)
      .and()
      .sessionManagement().sessionCreationPolicy(STATELESS);

  customizeRequestAuthorization(http.authorizeRequests()
      .antMatchers("/").permitAll()
      .antMatchers(POST, LOGIN_ENDPOINT).permitAll()
      .and());

  http.authorizeRequests().anyRequest().authenticated();

  JwtTokenService jwtTokenService = lookup("jwtTokenService");

  // JwtAuthenticationFilter must precede LogoutFilter, otherwise LogoutHandler wouldn't know who
  // logs out.
  customizeFilters(
      http.addFilterBefore(new JwtAuthenticationFilter(jwtTokenService), LogoutFilter.class));

  customizeRememberMe(http);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ManagementWebSecurityAutoConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    // secure endpoints
    RequestMatcher matcher = getRequestMatcher();
    if (matcher != null) {
        // Always protect them if present
        if (this.security.isRequireSsl()) {
            http.requiresChannel().anyRequest().requiresSecure();
        }
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        // Match all the requests for actuator endpoints ...
        http.requestMatcher(matcher);
        // ... but permitAll() for the non-sensitive ones
        configurePermittedRequests(http.authorizeRequests());
        http.httpBasic().authenticationEntryPoint(entryPoint);
        // No cookies for management endpoints by default
        http.csrf().disable();
        http.sessionManagement().sessionCreationPolicy(
                this.management.getSecurity().getSessions());
        SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
                this.security.getHeaders());
    }
}
项目:spring-boot-concourse    文件:ManagementWebSecurityAutoConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    // secure endpoints
    RequestMatcher matcher = getRequestMatcher();
    if (matcher != null) {
        // Always protect them if present
        if (this.security.isRequireSsl()) {
            http.requiresChannel().anyRequest().requiresSecure();
        }
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        // Match all the requests for actuator endpoints ...
        http.requestMatcher(matcher);
        // ... but permitAll() for the non-sensitive ones
        configurePermittedRequests(http.authorizeRequests());
        http.httpBasic().authenticationEntryPoint(entryPoint);
        // No cookies for management endpoints by default
        http.csrf().disable();
        http.sessionManagement().sessionCreationPolicy(
                this.management.getSecurity().getSessions());
        SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
                this.security.getHeaders());
    }
}
项目:contestparser    文件:ManagementWebSecurityAutoConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    // secure endpoints
    RequestMatcher matcher = getRequestMatcher();
    if (matcher != null) {
        // Always protect them if present
        if (this.security.isRequireSsl()) {
            http.requiresChannel().anyRequest().requiresSecure();
        }
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        // Match all the requests for actuator endpoints ...
        http.requestMatcher(matcher);
        // ... but permitAll() for the non-sensitive ones
        configurePermittedRequests(http.authorizeRequests());
        http.httpBasic().authenticationEntryPoint(entryPoint);
        // No cookies for management endpoints by default
        http.csrf().disable();
        http.sessionManagement().sessionCreationPolicy(
                this.management.getSecurity().getSessions());
        SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
                this.security.getHeaders());
    }
}
项目:find    文件:HodSecurity.java   
@SuppressWarnings("ProhibitedExceptionDeclared")
@Override
protected void configure(final HttpSecurity http) throws Exception {
    final AuthenticationEntryPoint ssoEntryPoint = new SsoAuthenticationEntryPoint(SsoController.SSO_PAGE);

    final SsoAuthenticationFilter<?> ssoAuthenticationFilter = new SsoAuthenticationFilter<>(SsoController.SSO_AUTHENTICATION_URI, EntityType.CombinedSso.INSTANCE);
    ssoAuthenticationFilter.setAuthenticationManager(authenticationManager());

    final LogoutSuccessHandler logoutSuccessHandler = new HodTokenLogoutSuccessHandler(SsoController.SSO_LOGOUT_PAGE, tokenRepository);

    http.regexMatcher("/public(/.*)?|/sso|/authenticate-sso|/api/authentication/.*|/logout")
        .csrf()
            .disable()
        .exceptionHandling()
            .authenticationEntryPoint(ssoEntryPoint)
            .accessDeniedPage(DispatcherServletConfiguration.AUTHENTICATION_ERROR_PATH)
            .and()
        .authorizeRequests()
            .antMatchers(FindController.APP_PATH + "/**").hasRole(FindRole.USER.name())
            .and()
        .logout()
            .logoutSuccessHandler(logoutSuccessHandler)
            .and()
        .addFilterAfter(ssoAuthenticationFilter, AbstractPreAuthenticatedProcessingFilter.class);
}
项目:DiscussionPortal    文件:AuthenticationHandler.java   
protected AuthenticationEntryPoint authenticationEntryPoint() {
    return new AuthenticationEntryPoint() {
        @Override
        public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
            httpServletResponse.getWriter().append("Not authenticated");
            httpServletResponse.setStatus(401);
        }
    };
}
项目:nifi-registry    文件:NiFiRegistrySecurityConfig.java   
private AuthenticationEntryPoint http401AuthenticationEntryPoint() {
    // This gets used for both secured and unsecured configurations. It will be called by Spring Security if a request makes it through the filter chain without being authenticated.
    // For unsecured, this should never be reached because the custom AnonymousAuthenticationFilter should always populate a fully-authenticated anonymous user
    // For secured, this will cause attempt to access any API endpoint (except those explicitly ignored) without providing credentials to return a 401 Unauthorized challenge
    return new AuthenticationEntryPoint() {
        @Override
        public void commence(HttpServletRequest request,
                             HttpServletResponse response,
                             AuthenticationException e) throws IOException, ServletException {
            logger.info("AuthenticationEntryPoint invoked as no user identity credentials were found in the request.");
            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        }
    };
}
项目:web-framework-for-java    文件:WebSecurityConfig.java   
@Bean
public AuthenticationEntryPoint restAuthenticationEntryPoint() {
    return new AuthenticationEntryPoint() {
        @Override
        public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException {
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED, ApplicationContext.language("error.msgUnauthorized"));
        }
    };
}
项目:oma-riista-web    文件:OneTimePasswordFilterConfigurer.java   
public OneTimePasswordFilterConfigurer(final String loginProcessingUrl,
                                       AuthenticationSuccessHandler successHandler,
                                       AuthenticationFailureHandler failureHandler,
                                       AuthenticationEntryPoint entryPoint) {
    this.authFilter = new OneTimePasswordAuthenticationFilter(loginProcessingUrl);
    this.authFilter.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher(loginProcessingUrl, "POST"));
    this.authFilter.setAuthenticationSuccessHandler(successHandler);
    this.authFilter.setAuthenticationFailureHandler(failureHandler);
    this.authFilter.setAllowSessionCreation(true);
    this.authenticationEntryPoint = entryPoint;
}
项目:spring-tsers-auth    文件:WebSecurityConfig.java   
private static AuthenticationEntryPoint getAuthEntryPoint() {
    return new AuthenticationEntryPoint() {
        @Override
        public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access Denied");
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootWebSecurityConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    if (this.security.isRequireSsl()) {
        http.requiresChannel().anyRequest().requiresSecure();
    }
    if (!this.security.isEnableCsrf()) {
        http.csrf().disable();
    }
    // No cookies for application endpoints by default
    http.sessionManagement().sessionCreationPolicy(this.security.getSessions());
    SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
            this.security.getHeaders());
    String[] paths = getSecureApplicationPaths();
    if (paths.length > 0) {
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        http.httpBasic().authenticationEntryPoint(entryPoint);
        http.requestMatchers().antMatchers(paths);
        String[] roles = this.security.getUser().getRole().toArray(new String[0]);
        SecurityAuthorizeMode mode = this.security.getBasic().getAuthorizeMode();
        if (mode == null || mode == SecurityAuthorizeMode.ROLE) {
            http.authorizeRequests().anyRequest().hasAnyRole(roles);
        }
        else if (mode == SecurityAuthorizeMode.AUTHENTICATED) {
            http.authorizeRequests().anyRequest().authenticated();
        }
    }
}
项目:stateless-rest-jwtcookie-demo    文件:SecurityInternalConfig.java   
/**
 * For a REST backend there's no login page, so security must return a 401
 * code
 *
 * @return
 */
@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
    return (HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) -> {
        LOG.info("ENTRY >>> rejecting entry: " + authException.getMessage());
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
    };
}
项目:pivotal-cla    文件:SecurityConfig.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    AuthenticationEntryPoint entryPoint = entryPoint();
    AdminRequestedAccessDeniedHandler accessDeniedHandler = new AdminRequestedAccessDeniedHandler(entryPoint);
    http
        .requiresChannel()
            .requestMatchers(request -> request.getHeader("x-forwarded-port") != null).requiresSecure()
            .and()
        .exceptionHandling()
            .authenticationEntryPoint(entryPoint)
            .accessDeniedHandler(accessDeniedHandler)
            .and()
        .csrf()
            .ignoringAntMatchers("/github/hooks/**").and()
        .authorizeRequests()
            .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
            .mvcMatchers("/login/**", "/", "/about", "/faq").permitAll()
            .mvcMatchers("/view/**").permitAll()
            .mvcMatchers("/webjars/**", "/assets/**").permitAll()
            .mvcMatchers("/github/hooks/**").permitAll()
            .mvcMatchers("/admin","/admin/cla/link/**","/admin/help/**").hasRole("ADMIN")
            .mvcMatchers("/admin/**","/manage/**").hasRole("CLA_AUTHOR")
            .anyRequest().authenticated()
            .and()
        .logout()
            .logoutSuccessUrl("/?logout");
}
项目:spring-boot-concourse    文件:SpringBootWebSecurityConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    if (this.security.isRequireSsl()) {
        http.requiresChannel().anyRequest().requiresSecure();
    }
    if (!this.security.isEnableCsrf()) {
        http.csrf().disable();
    }
    // No cookies for application endpoints by default
    http.sessionManagement().sessionCreationPolicy(this.security.getSessions());
    SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
            this.security.getHeaders());
    String[] paths = getSecureApplicationPaths();
    if (paths.length > 0) {
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        http.httpBasic().authenticationEntryPoint(entryPoint);
        http.requestMatchers().antMatchers(paths);
        String[] roles = this.security.getUser().getRole().toArray(new String[0]);
        SecurityAuthorizeMode mode = this.security.getBasic().getAuthorizeMode();
        if (mode == null || mode == SecurityAuthorizeMode.ROLE) {
            http.authorizeRequests().anyRequest().hasAnyRole(roles);
        }
        else if (mode == SecurityAuthorizeMode.AUTHENTICATED) {
            http.authorizeRequests().anyRequest().authenticated();
        }
    }
}
项目:contestparser    文件:SpringBootWebSecurityConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    if (this.security.isRequireSsl()) {
        http.requiresChannel().anyRequest().requiresSecure();
    }
    if (!this.security.isEnableCsrf()) {
        http.csrf().disable();
    }
    // No cookies for application endpoints by default
    http.sessionManagement().sessionCreationPolicy(this.security.getSessions());
    SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
            this.security.getHeaders());
    String[] paths = getSecureApplicationPaths();
    if (paths.length > 0) {
        AuthenticationEntryPoint entryPoint = entryPoint();
        http.exceptionHandling().authenticationEntryPoint(entryPoint);
        http.httpBasic().authenticationEntryPoint(entryPoint);
        http.requestMatchers().antMatchers(paths);
        String[] roles = this.security.getUser().getRole().toArray(new String[0]);
        SecurityAuthorizeMode mode = this.security.getBasic().getAuthorizeMode();
        if (mode == null || mode == SecurityAuthorizeMode.ROLE) {
            http.authorizeRequests().anyRequest().hasAnyRole(roles);
        }
        else if (mode == SecurityAuthorizeMode.AUTHENTICATED) {
            http.authorizeRequests().anyRequest().authenticated();
        }
    }
}
项目:incubator-atlas    文件:AtlasSecurityConfig.java   
public DelegatingAuthenticationEntryPoint getDelegatingAuthenticationEntryPoint() {
    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPointMap = new LinkedHashMap<>();
    entryPointMap.put(new RequestHeaderRequestMatcher("User-Agent", "Mozilla"), atlasAuthenticationEntryPoint);
    DelegatingAuthenticationEntryPoint entryPoint = new DelegatingAuthenticationEntryPoint(entryPointMap);
    entryPoint.setDefaultEntryPoint(getAuthenticationEntryPoint());
    return entryPoint;
}
项目:iris    文件:SecurityConfig.java   
@Bean
@Autowired
public DelegatingAuthenticationEntryPoint delegatingAuthenticationEntryPoint(BasicAuthenticationEntryPoint basic,
    LoginUrlAuthenticationEntryPoint login) {

    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<>();
    entryPoints.put(new RequestHeaderRequestMatcher("Content-Type", "application/json"), basic);
    entryPoints.put(new NegatedRequestMatcher(new RequestContainingAcceptTextHeaderRequestMatcher()), basic);

    DelegatingAuthenticationEntryPoint delegate = new DelegatingAuthenticationEntryPoint(entryPoints);
    delegate.setDefaultEntryPoint(login);

    return delegate;
}
项目:find    文件:IdolSecurity.java   
@SuppressWarnings("ProhibitedExceptionDeclared")
@Override
protected void configure(final HttpSecurity http) throws Exception {
    final LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<>();
    entryPoints.put(new AntPathRequestMatcher("/api/**"), new Http403ForbiddenEntryPoint());
    entryPoints.put(AnyRequestMatcher.INSTANCE, new LoginUrlAuthenticationEntryPoint(FindController.DEFAULT_LOGIN_PAGE));
    final AuthenticationEntryPoint authenticationEntryPoint = new DelegatingAuthenticationEntryPoint(entryPoints);

    http
        .csrf()
            .disable()
        .exceptionHandling()
            .authenticationEntryPoint(authenticationEntryPoint)
            .accessDeniedPage("/authentication-error")
            .and()
        .logout()
            .logoutUrl("/logout")
            .logoutSuccessUrl(FindController.DEFAULT_LOGIN_PAGE)
            .and()
        .authorizeRequests()
            .antMatchers(FindController.APP_PATH + "/**").hasAnyRole(FindRole.USER.name())
            .antMatchers(FindController.CONFIG_PATH).hasRole(FindRole.CONFIG.name())
            .antMatchers("/api/public/**").hasRole(FindRole.USER.name())
            .antMatchers("/api/bi/**").hasRole(FindRole.BI.name())
            .antMatchers("/api/config/**").hasRole(FindRole.CONFIG.name())
            .antMatchers("/api/admin/**").hasRole(FindRole.ADMIN.name())
            .antMatchers(FindController.DEFAULT_LOGIN_PAGE).permitAll()
            .antMatchers(FindController.LOGIN_PATH).permitAll()
            .antMatchers("/").permitAll()
            .anyRequest().denyAll()
            .and()
        .headers()
            .defaultsDisabled()
            .frameOptions()
            .sameOrigin();

    idolSecurityCustomizer.customize(http, authenticationManager());
}
项目:alv-ch-java    文件:WebAuthenticationEntryPointTest.java   
@Test
public void testGetBeansOfType() throws IOException, ServletException {
    AuthenticationEntryPoint entryPoint = new WebAuthenticationEntryPoint();
    HttpServletResponse response = new MockHttpServletResponse();
    entryPoint.commence(new MockHttpServletRequest(), response, new AuthenticationCredentialsNotFoundException("unknown user or password."));
    assertEquals("Unauthorized", ((MockHttpServletResponse) response).getErrorMessage());
    assertEquals(401, response.getStatus());
}
项目:opennmszh    文件:AntPatternBasedAuthenticationEntryPointChain.java   
/** {@inheritDoc} */
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {

    AuthenticationEntryPoint entryPoint = getAppropriateEntryPoint(request);

    entryPoint.commence(request, response, authException);
}
项目:opennmszh    文件:AntPatternBasedAuthenticationEntryPointChain.java   
private AuthenticationEntryPoint getAppropriateEntryPoint(HttpServletRequest request) {
    for (String pattern : m_patterns) {
        RequestMatcher matcher = new AntPathRequestMatcher(pattern);
        if (matcher.matches(request)) {
            return m_matchingEntryPoint;
        }
    }

    return m_nonMatchingEntryPoint;

}
项目:devicehive-java-server    文件:WebSecurityConfig.java   
@Bean
public AuthenticationEntryPoint unauthorizedEntryPoint() {
    return (request, response, authException) -> {
        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        response.getOutputStream().println(
                gson.toJson(new ErrorResponse(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage())));
    };
}
项目:devicehive-java-server    文件:WebSecurityConfig.java   
@Bean
public AuthenticationEntryPoint unauthorizedEntryPoint() {
    return (request, response, authException) -> {
        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        response.getOutputStream().println(
                gson.toJson(new ErrorResponse(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage())));
    };
}
项目:devicehive-java-server    文件:WebSecurityConfig.java   
@Bean
public AuthenticationEntryPoint unauthorizedEntryPoint() {
    return (request, response, authException) -> {
        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        response.getOutputStream().println(
                gson.toJson(new ErrorResponse(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage())));
    };
}
项目:users-service    文件:SecurityConfig.java   
public SecurityConfig(AuthenticationEntryPoint authenticationEntryPoint,
                      JwtAuthenticationProvider jwtAuthenticationProvider) {

    this.authenticationEntryPoint  = requireNonNull(authenticationEntryPoint);
    this.jwtAuthenticationProvider = requireNonNull(jwtAuthenticationProvider);
}
项目:Spring-5.0-Cookbook    文件:AppSecurityModelC.java   
@Bean
public AuthenticationEntryPoint setAuthPoint(){
return new AppAuthPoint("/login.html");
}
项目:Spring-5.0-Cookbook    文件:AppSecurityModelC.java   
@Bean
public AuthenticationEntryPoint setAuthPoint(){
return new AppAuthPoint("/login.html");
}
项目:jersey-jwt-springsecurity    文件:JwtAuthenticationTokenFilter.java   
public JwtAuthenticationTokenFilter(AuthenticationManager authenticationManager,
                                    AuthenticationEntryPoint authenticationEntryPoint) {
    this.authenticationManager = authenticationManager;
    this.authenticationEntryPoint = authenticationEntryPoint;
}
项目:spring-backend-boilerplate    文件:OpenApiSecurityConfigurer.java   
@Bean
public AuthenticationEntryPoint authenticationEntryPointImpl() {
    return new AuthenticationEntryPointRestImpl();
}
项目:springuni-particles    文件:SecurityConfigurationSupport.java   
@Bean
public AuthenticationEntryPoint authenticationEntryPoint(ObjectMapper objectMapper) {
  return new JwtAuthenticationEntryPoint(objectMapper);
}
项目:judge    文件:SecurityConfiguration.java   
@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
    return (request, response, authException) -> request.getRequestDispatcher("/unauthorized").forward(request, response);
}
项目:oma-riista-web    文件:JwtAuthenticationFilter.java   
public JwtAuthenticationFilter(final AuthenticationManager authenticationManager,
                               final AuthenticationEntryPoint entryPoint) {
    this.authenticationManager = authenticationManager;
    this.entryPoint = entryPoint;
}
项目:raptor    文件:AuthenticationConfiguration.java   
@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
    return new RaptorAuthenticationEntryPoint();
}
项目:shinyproxy    文件:KeycloakAuthenticationType.java   
protected AuthenticationEntryPoint authenticationEntryPoint() throws Exception {
    return new KeycloakAuthenticationEntryPoint(adapterDeploymentContext());
}
项目:pivotal-cla    文件:SecurityConfig.java   
private AdminRequestedAccessDeniedHandler(AuthenticationEntryPoint entryPoint) {
    AccessDeniedHandlerImpl deniedHandler = new AccessDeniedHandlerImpl();
    deniedHandler.setErrorPage("/error/403");
    this.deniedHandler = deniedHandler;
    this.entryPoint = entryPoint;
}
项目:putput    文件:WebSecurityConfig.java   
private AuthenticationEntryPoint getAuthenticationEntryPoint() throws IOException {
  return (request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
}
项目:payment-api    文件:SecurityConfig.java   
@Bean
public AuthenticationEntryPoint unauthorizedEntryPoint() {
    return (request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
}
项目:rest    文件:MyBasicAuthenticationFilter.java   
protected AuthenticationEntryPoint getAuthenticationEntryPoint() {
    return authenticationEntryPoint;
}
项目:rest    文件:MyBasicAuthenticationFilter.java   
/**
 * @deprecated Use constructor injection
 */
@Deprecated
public void setAuthenticationEntryPoint(AuthenticationEntryPoint authenticationEntryPoint) {
    this.authenticationEntryPoint = authenticationEntryPoint;
}