Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java KerberosAuthenticationProvider与KerberosServiceAuthenticationProvider_Java_Spring_Spring Security_Kerberos_Spring Security Kerberos - Fatal编程技术网

Java KerberosAuthenticationProvider与KerberosServiceAuthenticationProvider

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(

莫恩

我在项目中使用SpringSecurity5和Kerberos进行SSO身份验证

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。。。