我正在设置一个授权服务器,它使用 Kerberos (SSO) 对 Windows 网络内的用户进行身份验证。并且,它使用基本身份验证来对网络外的用户进行身份验证。
当我尝试使用网络内的机器访问/oauth/authorize端点时,kerberos SSO 可以完美运行,而无需询问我的用户名和密码。但是,当我尝试使用网络外的机器访问同一端点时,会出现浏览器登录弹出窗口并隐藏我的自定义登录页面,直到我单击取消。
我想在访问/oauth/authorize端点时禁用登录弹出窗口。
我的配置:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.exceptionHandling()
.authenticationEntryPoint(spnegoEntryPoint())
.and()
.authorizeRequests()
.antMatchers("/", "/home", "/check", "/favicon.ico").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login").permitAll()
.and()
.logout()
.permitAll()
.and()
.addFilterBefore(
spnegoAuthenticationProcessingFilter(authenticationManagerBean()),
BasicAuthenticationFilter.class);
}
@Bean
public SpnegoEntryPoint spnegoEntryPoint() {
return new SpnegoEntryPoint("/login");
}