本文整理匯總了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;
}