precisa de exemplo de configuração java de segurança de primavera mostrando somente autenticação básica
Minha configuração atual de segurança do java é a seguinte:
@Configuration
@EnableWebSecurity
public class RootConfig extends WebSecurityConfigurerAdapter {
@Override
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception
{
auth.inMemoryAuthentication()
.withUser("tester").password("passwd").roles("USER");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeUrls()
.anyRequest().authenticated()
.and()
.httpBasic();
}
}
Quando executo uma solicitação GET usando um navegador, recebo um erro 403. Espero obter um pop-up do navegador solicitando um nome de usuário / senha. Qual pode ser o problema?