Spring security returns Login Page instead of value

ساخت وبلاگ
چکیده : Vote count: 0 I added spring security ... با عنوان : Spring security returns Login Page instead of value بخوانید :

Vote count: 0

I added spring security to /api/** url (I have custom filter and custom provider). But of course I did mistake and can't find it: after successful authentication spring security redirects me to login page instead of call /api/sendhellowrold and returns me "Hello World" string. It works if I added successful handler and sendRedirect to page which should return me HTML. This is ok, but not about rest api

this is my configure method

 @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.antMatcher("/api/**").csrf().disable()
                .authorizeRequests()
                .antMatchers("/api/**").authenticated()
                .and()
                .addFilterAfter(createSsoTokenFilter(), UsernamePasswordAuthenticationFilter.class);
    }

 @Bean
    public SsoTokenFilter createSsoTokenFilter() throws Exception {
        SsoTokenFilter ssoTokenFilter = new SsoTokenFilter();
        ssoTokenFilter.setAuthenticationManager(authenticationManagerBean());
        return ssoTokenFilter;
    }
asked 54 secs ago
FoxNet

back soft...
ما را در سایت back soft دنبال می کنید

نویسنده : استخدام کار بازدید : 48 تاريخ : سه شنبه 2 مرداد 1397 ساعت: 22:20