Wpis z mikrobloga

Miał ktoś w Springu taki problem, że endpoint /login nie jest mapowany i przez to nie mogę się zalogować? Chce sobie stworzyć szkielet Angularowo-RESTowo-Springowej apki bez Boota, żeby mieć zawsze pod ręką jak wpadnie mi jakiś pomysł, ale zaciąłem się na logowaniu :/

Moja konfiguracja sekjuriti:


@Override
protected void configure(AuthenticationManagerBuilder builder) throws Exception {
builder.inMemoryAuthentication().withUser("user").password("user").roles("USER").and().withUser("admin")
.password("admin").roles("ADMIN");
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/xx/").authenticated()
.and().csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
.and().exceptionHandling().authenticationEntryPoint(authenticationEntryPoint)
.and().formLogin().successHandler(authenticationSuccessHandler)
.failureHandler(authenticationFailureHandler).permitAll();
}

@Bean
protected CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost", "http://127.0.0.1"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/
", configuration);
return source;
}
#java #spring #programowanie
  • 7
@Bauzzer: no to wychodzi na to, że jhipster robi dokładnie to samo, tylko zamiast klikania wpisujesz polecenie ;]

@Szinek: niestety, jak pisałęm, nie-programista, nie znam się, nie wiem co może być nie tak.

u mnie w PHP wszystko jest prostrze i śmiać mi się chce z Javy i C# gdy przychodzi zrobić "stronkę" ( ͡° ͜ʖ ͡°)