本文整理汇总了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()
;
}
示例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;
}
示例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);
}
};
}
示例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;
}
示例5: getJwtAccessDeniedHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler getJwtAccessDeniedHandler() {
JwtAccessDeniedHandler handler = new JwtAccessDeniedHandler();
return handler;
}
示例6: accessDeniedHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler accessDeniedHandler(){
AccessDeniedHandlerCustomImpl handler = new AccessDeniedHandlerCustomImpl();
handler.setErrorPage("/accessDenied");
return handler;
}
示例7: accessDeniedHandlerImpl
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler accessDeniedHandlerImpl() {
return new AccessDeniedHandlerRestImpl();
}
示例8: nonRedirectingAccessDeniedHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
@Bean
public AccessDeniedHandler nonRedirectingAccessDeniedHandler(){
return new AccessDeniedHandlerImpl();
}
示例9: accessDeniedHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
private AccessDeniedHandler accessDeniedHandler() {
return new CsrfAccessDeniedHandler() {
};
}
示例10: setOrdinaryAccessDeniedHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
public void setOrdinaryAccessDeniedHandler(AccessDeniedHandler pImpl) {
this.pImpl = pImpl;
}
示例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());
}
示例12: getOAuthFailureHandler
import org.springframework.security.web.access.AccessDeniedHandler; //导入依赖的package包/类
/**
* The oauth failure handler.
*
* @return The oauth failure handler.
*/
public AccessDeniedHandler getOAuthFailureHandler() {
return OAuthFailureHandler;
}
示例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;
}