0
votes

I am using Anypoint Studio 6.2 and Mule runtime 3.8.3.

I want to log into an SQL Server database using Windows Auth and an article that says I should

"connect to the MS SQL Server database using the credentials of the user running the Mule runtime process by providing the integratedSecurity=true parameter to the JDBC URL. Something like this: jdbc:sqlserver://sqlserver;integratedSecurity=true;"

How do I find the username against the mule runtime or change the username to something different?

Thanks

1
If it is Windows Authentication you will be hitting SQL Server using the Windows account which runs this client. If you want to run using different context you might require to run this process using different windows user context - Kannan Kandasamy

1 Answers

0
votes

If your Anypoint Studio is Windows application, you can launch it using runas command indicating account you want to pass to SQL Server (or shift + right click on the program icon using GUI -> Run as different user)

You can also change login context from your T-SQL code, see EXECUTE AS (Transact-SQL)

Example:

execute as login = 'MyDomain\MyAccount';
select system_user;

You should have IMPERSONATE on that login for be able to do it in your code