Java KerberosAuthenticationProvider与KerberosServiceAuthenticationProvider
莫恩 我在项目中使用SpringSecurity5和Kerberos进行SSO身份验证 在Java KerberosAuthenticationProvider与KerberosServiceAuthenticationProvider,java,spring,spring-security,kerberos,spring-security-kerberos,Java,Spring,Spring Security,Kerberos,Spring Security Kerberos,莫恩 我在项目中使用SpringSecurity5和Kerberos进行SSO身份验证 在WebSecurityConfig中,我注册了两个AuthenticationProvider @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(msfUserDetailsService).passwordEncoder(
WebSecurityConfig
中,我注册了两个AuthenticationProvider
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(msfUserDetailsService).passwordEncoder(passwordEncoder());
assertThatUnlimitedCryptographyEnabled();
// Two providers
auth.authenticationProvider(kerberosAuthenticationProvider());
auth.authenticationProvider(kerberosServiceAuthenticationProvider());
}
从这两个例子中可以看出,这似乎就是它的工作方式:
KerberosServiceAuthenticationProvider
是验证Kerberos票证的提供者(请参阅)
但是,KerberosAuthenticationProvider
用于什么?在这种情况下,法律只是说
kerberos的AuthenticationProvider
正如您所说:
kerberoserviceauthenticationprovider
用于验证SSO身份验证中的票据,而KerberosAuthenticationProvider
用于基于表单的身份验证,当客户端不支持SSO(例如linux系统上的浏览器)时,通常将其用作回退。此类型的身份验证由应用于WebSecurityConfigureAdapter
中的UsernamePasswordAuthenticationFilter
处理:
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
...
.formLogin()
...
}
...
}
如果您不使用表单登录,那么您可以省略注释中指出的此提供程序。您是否在没有
KerberosAuthenticationProvider
的情况下尝试过它?发生了什么事?它仅用于表单登录或HTTP基本登录。我认为,它只是作为一个后备方案,没有SSO是可能的。你是对的,它在没有SSO的情况下工作。AuthenticationProvider链的末尾包含一个处理密码凭据的DAOAAuthenticationProvider。到目前为止,似乎根本不需要KerberosAuthenticationProvider。可能旧版本中缺少DaoAuthenticationProvider。。。