логин всегда возвращает 403 при весенней загрузке с использованием zuul - PullRequest
0 голосов
/ 04 мая 2020
• 1000 *
http.cors().and().csrf().disable().authorizeRequests()
                .antMatchers("/login")
                .anonymous()
                .antMatchers("/auth/**")
                .anonymous()
                .antMatchers(HttpMethod.GET,"/users/username/**")
                .permitAll()
                .anyRequest().authenticated()
                .and()
                .addFilter(new JWTAuthenticationFilter(new JWTAuthenticator(authenticationManager()), userDetailService))
                .addFilter(new JWTAuthorizationFilter(authenticationManager()))
                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

и API-безопасность шлюза:

 http.cors().and().csrf().disable()
                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
                .authorizeRequests()
                .antMatchers("/auth-microservice/login")
                .permitAll()
                .antMatchers("/auth-microservice/**")
                .permitAll()
                .and()
                .addFilter(new JWTAuthenticationFilter(new JWTAuthenticator(authenticationManager()), userMicroService))
        .addFilter(new JWTAuthorizationFilter(authenticationManager()));

userMicroService вызывает службу аутентификации в "/ users / username" и получает информацию о пользователе. .

Я могу получить доступ ко всем конечным точкам "/ auth / **". Так в чем проблема?

...