select auth_scheme from sys.dm_exec_connections where session_id=@@spid3. Registered SPN for service account for Kerbros authentication using below command-
setspn -s MSSQLSvc/FQDN <domain>\<Service account>
4. Below connection string is getting used to connect to the database in the Ansible playbook-
url: jdbc:{{ db_conn }}{{ hostname }}:{{ db_port}};database_name={{ dbname}};integratedSecurity=true;authenticationScheme=JavaKerberos
username: {{ base_username }}
password: {{ base_password }}
where base_username is a variable which contains username in "user...@MY.DOMAIN.COM" format.
base_password is a variable which contains Vault password.
5. Playbook Site.yml format-
- name: Template SQL Scripts into XML Format for Liquibase
gather_facts: true
hosts: localhost
roles:
- { role: generating_properties, tags:["properties_generating"]
- { role: maven_liquibase, tags:["install_maven"] }
environment:
LIBRARY_PATH: "{{ LIBRARY_PATH}}"
6. logged into the database manually using this AD user and it's accessing the database successfully.
Note- It's connecting successfully to the database when using SQL authenticated credential.
Can anyone help in troubleshooting this issue?