Java 类org.springframework.security.web.access.AccessDeniedHandler 实例源码

项目:sushi-bar-BE    文件:WebSecurityConfig.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.exceptionHandling().accessDeniedHandler(new AccessDeniedHandler() {
        @Override
        public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException {
            accessDeniedException.printStackTrace();
        }
    })
            .and()
            .authorizeRequests()
            .antMatchers("/registration").permitAll()
            .anyRequest().authenticated()
            .and()
            .httpBasic()
            .and()
            .csrf().disable()
    ;
}
项目:sns-todo    文件:FormLoginSecurityConfig.java   
@Autowired
public FormLoginSecurityConfig(AccessDeniedHandler accessDeniedHandler,
                               UserDetailsService userDetailsService,
                               OAuth2ClientContext oauth2ClientContext) {
    this.accessDeniedHandler = accessDeniedHandler;
    this.userDetailsService = userDetailsService;
    this.oauth2ClientContext = oauth2ClientContext;
}
项目:DiscussionPortal    文件:AuthenticationHandler.java   
protected AccessDeniedHandler accessDeniedHandler() {
    return new AccessDeniedHandler() {
        @Override
        public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
            httpServletResponse.getWriter().append("Access denied");
            httpServletResponse.setStatus(403);
        }
    };
}
项目:InfoSys-1D    文件:ProfChoperSecurityConfig.java   
@Autowired
public ProfChoperSecurityConfig(@Qualifier("profChoperDataSource") DataSource dataSource,
                                AccessDeniedHandler accessDeniedHandler,
                                AuthenticationSuccessHandler successHandler) {

    this.dataSource = dataSource;
    this.accessDeniedHandler = accessDeniedHandler;
    this.successHandler = successHandler;
}
项目:Practical-Microservices    文件:SpringSecurityConfiguration.java   
@Bean
public AccessDeniedHandler getJwtAccessDeniedHandler() {
    JwtAccessDeniedHandler handler = new JwtAccessDeniedHandler();
    return handler;
}
项目:Smart-Shopping    文件:WebSecurityConfig.java   
@Bean
public AccessDeniedHandler accessDeniedHandler(){
    AccessDeniedHandlerCustomImpl handler = new AccessDeniedHandlerCustomImpl();
    handler.setErrorPage("/accessDenied");
    return handler;
}
项目:spring-backend-boilerplate    文件:OpenApiSecurityConfigurer.java   
@Bean
public AccessDeniedHandler accessDeniedHandlerImpl() {
    return new AccessDeniedHandlerRestImpl();
}
项目:Spring-Security-Third-Edition    文件:SecurityConfig.java   
@Bean
public AccessDeniedHandler nonRedirectingAccessDeniedHandler(){
    return new AccessDeniedHandlerImpl();
}
项目:bag-database    文件:SecurityConfig.java   
private AccessDeniedHandler accessDeniedHandler() {
    return new CsrfAccessDeniedHandler() {
    };
}
项目:aggregate    文件:GWTAccessDeniedHandlerImpl.java   
public void setOrdinaryAccessDeniedHandler(AccessDeniedHandler pImpl) {
    this.pImpl = pImpl;
}
项目:ConfLab    文件:WebSecurityConfig.java   
@Bean
public AccessDeniedHandler accessDeniedHandler() {
    LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler> handlers = new LinkedHashMap<>();
    handlers.put(CsrfException.class, new CsrfTokenExceptionHandler());
    return new DelegatingAccessDeniedHandler(handlers, new AccessDeniedHandlerImpl());
}
项目:oauth-client-master    文件:OAuthConsumerContextFilter.java   
/**
 * The oauth failure handler.
 *
 * @return The oauth failure handler.
 */
public AccessDeniedHandler getOAuthFailureHandler() {
    return OAuthFailureHandler;
}
项目:oauth-client-master    文件:OAuthConsumerContextFilter.java   
/**
 * The oauth failure handler.
 *
 * @param OAuthFailureHandler The oauth failure handler.
 */
public void setOAuthFailureHandler(AccessDeniedHandler OAuthFailureHandler) {
    this.OAuthFailureHandler = OAuthFailureHandler;
}