Spring Boot MSSQL Kerberos身份验证 [英] Spring Boot MSSQL Kerberos Authentication

查看:755
本文介绍了Spring Boot MSSQL Kerberos身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前在我的春季启动application.properties文件中,我指定了以下几行以连接到MSSql服务器.

Currently in my spring boot application.properties file, I am specifying following lines to connect to MSSql server.

spring.datasource.url=jdbc:sqlserver://localhost;databaseName=springbootd

spring.datasource.username=sa

spring.datasource.password=Projects@123

我不想使用用户名和密码,而是想使用kerberos对用户进行身份验证,这是我将要进行的所有更改.

Instead of giving username and password, I want to authenticate user using kerberos, what all changes I will have to make.

我尝试搜索JPA官方文档,但找不到任何文档.这里的线索表示赞赏.

I tried searching in the JPA official documentation but could not find any. Leads here are appreciated.

推荐答案

基本上,您需要正确设置krb5.conf文件.您可以通过以下命令并输入密码来验证该配置:

Basically, you need to set up your krb5.conf file properly. You can verify that configuration via the following command and entering your password:

kinit <user-name>

此外,请确保您具有JDBC URL,例如:

Additionally, make sure you have a JDBC URL like:

jdbc:sqlserver://servername=server_name;integratedSecurity=true;authenticationScheme=JavaKerberos;userName=user@REALM;password=****

请参见

See Microsoft JDBC driver documentation for details.

忘记提及启动参数.添加以下JVM参数:

Forgot to mention the startup arguments. Add the following JVM argument:

-Djava.security.krb5.conf=<PATH_TO>/krb5.conf

如果您使用默认的krb5.conf但不是完全确定,我相信这不是必需的.

I believe this is not neccessary if you use the default krb5.conf but not entirely sure.

这篇关于Spring Boot MSSQL Kerberos身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆