2

after reviewing a lot on the internet, I can not find a solution. I hope you understand me, my English is not the best ...

Issue:

I want to authenticate against SQL Server with a valid user for the domain (active directory) which I get it from the login (username and password) of my application (old application). This user, which is logged into my application, is a user validated by Active Directory (LDAP) and is a member of a Group that has logging permissions on the SQL Server ("Domain \ Group_name").

Attempts:

So the problem is that if I use windows authentication (it works fine) I would be using the windows user and not the application user (it is not always the same user). On the other hand, if I use SQL Server authentication I have to create and maintain the passwords of these users separately from the domain ...

Question:

How do I authenticate to SQL Server with a user logged in to my application. User who is a member of a Domain Group, which has logging permission in SQL Server but is not always the user windows logued on?

EXAMPLE:

Users: usr1 and usr2 both valid domain users

Usr1 is a member of the group that has access to SQL Server.

Usr2 is NOT a member of the SQL Server access group (can not log in).

I want to log in Windows with usr2 and in the application with usr1. Both with domain credentials.

Thanks in advance.

M84
  • 727
  • 6
  • 14
  • 1
    This might be what you're looking for: [Connect different Windows User in SQL Server Management Studio (2005 or later)](http://stackoverflow.com/q/849149/2333499) – SqlZim Dec 27 '16 at 16:25
  • @SqlZim, Yes, I saw that possibility but I wanted to know if there was another authentication option. This way I have to open the application with the windows user and once done the authentication of my application, I should close it and open it again with a "runas" of the user that was logged in the application ... that does not seem Something "correct" but apparently is the only option ... Thanks! – M84 Dec 27 '16 at 17:56
  • Are you writing your own application to connect to SQL server? In C#, for example, you can authenticate a different user account (ask the user for a different username/password) and use that to connect to SQL Server. – Gabriel Luci Dec 28 '16 at 03:22
  • @GabrielLuci, No, it's an old vb6 application that I'm trying to improve. Being able to use the domain user would already remove an authentication method from the application, which would not have to maintain so many credentials per user. – M84 Dec 28 '16 at 11:37

1 Answers1

0

The only solution than i can find was the "runas", like SqlZim saw.

Thanks.

M84
  • 727
  • 6
  • 14