3

It doesn't seem possible to craft a connection string so that you can open a connection to a mssql server using another user's windows credentials. It appears you are limited to specifying either a sql server account, or specifying no creds at all which passes along the current set being used on the domain.

What workarounds are effective ways to circumvent this restriction?

A bit of background:
The company I'm deploying at would like to set up windows credentials for each application accessing the shared databases. This works well for daemon-like background tasks, but it seems a bit complicated for desktop applications.

I've been asked to NOT pass the users creds to the database, but instead pass a set of windows creds reserved for the application itself... not sql server credentials, but an account on the domain for the application.

I've been contemplating using Runas to launch the application (written in Python) using this application windows account.

Perhaps someone out there can suggest a better way?

2 Answers 2

1

You could set up a domain group (active directory) for the application, then assign specific domain users to be in that group. The I suppose you could grant privileges to the database for that group.

This would allow specific permissions to be controlled for the group.

Just a suggestion, I hope it helps. Good luck!

Sign up to request clarification or add additional context in comments.

1 Comment

Understandable... Sometimes in order to succeed though, you need to tell the customer when it can't be done by their rules. I really hate to say "can't" but some times the rules are just too unreasonable. Good Luck with it!
1

There is no way to, in the connection string, specify an alternative set of Windows credentials. Your instinct about runas is spot on. I often use that to launch SSMS when connecting to a different domain than my laptop is on. Good luck!

1 Comment

Too bad about that prompt though... starts to feel 'hacky', you know what I mean?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.