1
resposta

Actuator dando erro 403

Eu fiz como a aula e deixei configurado da seguinte forma meu SecurityConfigurations:

protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
        .antMatchers(HttpMethod.GET, "/topicos").permitAll()
        .antMatchers(HttpMethod.GET, "/topicos/*").permitAll()
        .antMatchers(HttpMethod.POST, "/auth").permitAll()
        .antMatchers(HttpMethod.GET, "/actuator").permitAll()
        .antMatchers(HttpMethod.GET, "/actuator/**").permitAll()
        .anyRequest().authenticated()
        .and().csrf().disable()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
        .and().addFilterBefore(new AutenticacaoViaTokenFilter(tokenService,usuarioRepository), UsernamePasswordAuthenticationFilter.class);
    }

mas pra acessar o /actuator e o /actuator/** eu preciso estar autenticando isso esta correto, pois na aula ele o instrutor não precisou (ou pelo menos eu não reparei) que foi enviada o token de autenticação junto com as chamadas get

1 resposta

Oi Joao,

Consegue compartilhar o seu projeto?