Flyway GSS身份验证失败Postgres连接错误

时间:2018-01-13 00:13:32

标签: postgresql jdbc kerberos flyway

尝试使用Flyway连接到Postgres实例时,出现GSS Authentication failed连接错误:

Unable to obtain Jdbc connection from DataSource
(
  jdbc:postgresql://host/database?
  kerberosServerName=postgres&
  jaasApplicationName=pgjdbc
) 
for user 'username@domain.com': GSS Authentication failed

My Postgres实例使用gss身份验证和MIT Kerberos使用大写域名(领域)对我的Active Directory进行身份验证,但在Postgres上,由于pg-ldap-sync工具创建用户的方式,我们使用的是小写域。

我可以使用psql和小写域名进行连接: psql -h postgres.domain.com -U username@domain.com

但是,当我尝试使用相同的凭据运行Flyway时,由于我未提供与该域匹配的正确域名,我收到GSS Authentication failed

从它的外观来看,使用GSS时,JDBC驱动程序正在使用的JDBC驱动程序只能发送身份验证用户,因此如果数据库用户不匹配,则无法映射它。由于无法通过JDBC驱动程序单独发送数据库用户,因此它会回退到身份验证用户,并且映射失败。

如何提供与用于Kerberos身份验证的主体不同的Postgres用户?与我对psql所能做的类似。

我的JAAS配置:

pgjdbc
{
  com.sun.security.auth.module.Krb5LoginModule required
  doNotPrompt=true
  useTicketCache=true
  debug=true
  client=true;
};

0 个答案:

没有答案
相关问题