当前位置: 首页>>代码示例>>Java>>正文


Java AccessDeniedHandler类代码示例

本文整理汇总了Java中org.springframework.security.web.access.AccessDeniedHandler的典型用法代码示例。如果您正苦于以下问题:Java AccessDeniedHandler类的具体用法?Java AccessDeniedHandler怎么用?Java AccessDeniedHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AccessDeniedHandler类属于org.springframework.security.web.access包,在下文中一共展示了AccessDeniedHandler类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@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()
    ;
}
 
开发者ID:egch,项目名称:sushi-bar-BE,代码行数:19,代码来源:WebSecurityConfig.java

示例2: FormLoginSecurityConfig

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Autowired
public FormLoginSecurityConfig(AccessDeniedHandler accessDeniedHandler,
                               UserDetailsService userDetailsService,
                               OAuth2ClientContext oauth2ClientContext) {
    this.accessDeniedHandler = accessDeniedHandler;
    this.userDetailsService = userDetailsService;
    this.oauth2ClientContext = oauth2ClientContext;
}
 
开发者ID:helloworldtang,项目名称:sns-todo,代码行数:9,代码来源:FormLoginSecurityConfig.java

示例3: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
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);
		}
	};
}
 
开发者ID:vishal1997,项目名称:DiscussionPortal,代码行数:10,代码来源:AuthenticationHandler.java

示例4: ProfChoperSecurityConfig

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Autowired
public ProfChoperSecurityConfig(@Qualifier("profChoperDataSource") DataSource dataSource,
                                AccessDeniedHandler accessDeniedHandler,
                                AuthenticationSuccessHandler successHandler) {

    this.dataSource = dataSource;
    this.accessDeniedHandler = accessDeniedHandler;
    this.successHandler = successHandler;
}
 
开发者ID:ericywl,项目名称:InfoSys-1D,代码行数:10,代码来源:ProfChoperSecurityConfig.java

示例5: getJwtAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler getJwtAccessDeniedHandler() {
	JwtAccessDeniedHandler handler = new JwtAccessDeniedHandler();
	return handler;
}
 
开发者ID:PacktPublishing,项目名称:Practical-Microservices,代码行数:6,代码来源:SpringSecurityConfiguration.java

示例6: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler accessDeniedHandler(){
	AccessDeniedHandlerCustomImpl handler = new AccessDeniedHandlerCustomImpl();
	handler.setErrorPage("/accessDenied");
	return handler;
}
 
开发者ID:Azanx,项目名称:Smart-Shopping,代码行数:7,代码来源:WebSecurityConfig.java

示例7: accessDeniedHandlerImpl

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler accessDeniedHandlerImpl() {
    return new AccessDeniedHandlerRestImpl();
}
 
开发者ID:melthaw,项目名称:spring-backend-boilerplate,代码行数:5,代码来源:OpenApiSecurityConfigurer.java

示例8: nonRedirectingAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler nonRedirectingAccessDeniedHandler(){
    return new AccessDeniedHandlerImpl();
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:5,代码来源:SecurityConfig.java

示例9: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
private AccessDeniedHandler accessDeniedHandler() {
    return new CsrfAccessDeniedHandler() {
    };
}
 
开发者ID:swri-robotics,项目名称:bag-database,代码行数:5,代码来源:SecurityConfig.java

示例10: setOrdinaryAccessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
public void setOrdinaryAccessDeniedHandler(AccessDeniedHandler pImpl) {
    this.pImpl = pImpl;
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:4,代码来源:GWTAccessDeniedHandlerImpl.java

示例11: accessDeniedHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler accessDeniedHandler() {
    LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler> handlers = new LinkedHashMap<>();
    handlers.put(CsrfException.class, new CsrfTokenExceptionHandler());
    return new DelegatingAccessDeniedHandler(handlers, new AccessDeniedHandlerImpl());
}
 
开发者ID:vitalii-dmytruk,项目名称:ConfLab,代码行数:7,代码来源:WebSecurityConfig.java

示例12: getOAuthFailureHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
/**
 * The oauth failure handler.
 *
 * @return The oauth failure handler.
 */
public AccessDeniedHandler getOAuthFailureHandler() {
	return OAuthFailureHandler;
}
 
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:9,代码来源:OAuthConsumerContextFilter.java

示例13: setOAuthFailureHandler

import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
/**
 * The oauth failure handler.
 *
 * @param OAuthFailureHandler The oauth failure handler.
 */
public void setOAuthFailureHandler(AccessDeniedHandler OAuthFailureHandler) {
	this.OAuthFailureHandler = OAuthFailureHandler;
}
 
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:9,代码来源:OAuthConsumerContextFilter.java


注:本文中的org.springframework.security.web.access.AccessDeniedHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。