मैंने मिला निम्नलिखित वसंत सुरक्षा विन्यास:स्प्रिंग बूट: accessDeniedHandler काम नहीं करता है
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/api/private/**", "/app/**").authenticated();
http.csrf().disable();
http.logout().logoutSuccessUrl("/");
http.exceptionHandling().accessDeniedPage("/403"); //.accessDeniedHandler(accessDeniedHandler);
}
}
मैं तर्क निम्नलिखित उम्मीद: नहीं authenitcated उपयोगकर्ताओं /403
पुनः निर्देशित किया जाएगा। उस वसंत के बजाय डिफ़ॉल्ट टोमकैट 403 पेज प्रदर्शित करता है। मैंने किसी भी सफलता के साथ कस्टम accessDeniedHandler
भी कोशिश की।
मैं एक्सेस विफलता पर कस्टम तर्क कैसे कार्यान्वित कर सकता हूं?