此内容没有您所选择的语言版本。
8.4. Kerberos Support: JDBC Client Configuration
Procedure 8.3. Setup Kerberos for JDBC Client
Set JAAS configuration
In the client VM the JAAS configuration for kerberos authentication needs to be written. Here is sample configuration file (client.conf
):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set JVM configuration
Add the following JVM options to your client's startup script. Changerealm
andkdc
settings according to your environment:-Djava.security.krb5.realm=EXAMPLE.COM -Djava.security.krb5.kdc=kerberos.example.com -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=false -Djava.security.auth.login.config=/path/to/client.conf
-Djava.security.krb5.realm=EXAMPLE.COM -Djava.security.krb5.kdc=kerberos.example.com -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=false -Djava.security.auth.login.config=/path/to/client.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Or if you want to control thekdc
andrealm
system wide, use below instead.-Djava.security.krb5.conf=/path/to/krb5.conf (on Linux /etc/krb5.conf) -Djava.security.auth.login.config=/path/to/client.conf -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=false
-Djava.security.krb5.conf=/path/to/krb5.conf (on Linux /etc/krb5.conf) -Djava.security.auth.login.config=/path/to/client.conf -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set URL connection properties
Add the following URL connection properties to the JBoss Data Virtualization JDBC connection string:authenticationType=KRB5;jaasName=Client;kerberosServicePrincipleName=dv/my.host.com@EXAMPLE.COM
authenticationType=KRB5;jaasName=Client;kerberosServicePrincipleName=dv/my.host.com@EXAMPLE.COM
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
There is no need to provide the username and password. When the application makes a JDBC connection, it will authenticate locally and use the same user credentials to negotiate a service token with the server and grant the connection. For more information on connection properties and how to configure data sources, see the JBoss Data Virtualization Platform Development Guide.