で私は、特定のURLパターンのためのHTTP基本認証を持っていると思います。
詳細に
私は自分のアプリケーションのためのAPIインタフェースを作成していますし、それは簡単なHTTP基本認証によって認証される必要があります。しかし、他のウェブページはでなければ、はHTTPの基本的なものを使用するのではなく、通常のフォームログインを使用するべきです。
現在の構成 - 2日を待っていた
@Override
protected void configure(HttpSecurity http) throws Exception {
http //HTTP Security
.csrf().disable() //Disable CSRF
.authorizeRequests() //Authorize Request Configuration
.antMatchers("/connect/**").permitAll()
.antMatchers("/", "/register").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/api/**").hasRole("API")
.anyRequest().authenticated()
.and() //HTTP basic Authentication only for API
.antMatcher("/api/**").httpBasic()
.and() //Login Form configuration for all others
.formLogin().loginPage("/login").permitAll()
.and() //Logout Form configuration
.logout().permitAll();
}
その基本的なhttp authポップアップを削除する方法を教えてください。私はすべてを試みましたが、そうすることができませんでした。 – 89n3ur0n
httpBasicを使用しないで、formLoginを使用してください。 –
は、成功しなかったので、httpBasic()。disable()で無効にしてformLogin()を使用しましたが、修正されていないようです。 – 89n3ur0n