x
login about faq Site discussion (meta-askssc)

Connect an application to a SQL Server database using Windows Authentication and Application Role

I have a VB (VS2008) application which uses a standard db connection string to log into the SQL Server (2005 / 2008) database that it uses, with Windows Authentication mode:

Data Source=HostName\DBMS Instance; Initial Catalog=DatabaseName; Integrated Security=True

This works fine in development, but in the live environment it seems to require each specific user to be set up as a member of a security group within SQL Server in order to gain access to the database and perform the standard db table actions. This is obviously unwieldy as it may require several hundred users to be added, and then extensive maintence to keep the list up to date.

I am assuming that there is a better way of doing this, either by setting up a group with the appropriate permissions to which all members of the organisation belong ("Everyone"), or by creating an Application Role for the target database.

Can I get by with the first option (in which case how), or do I need the second approach, in which case what alteration do I need to make to my code to jump this new security hurdle? (Unfortunately, the SQL DBA doesn't seem to know very much and can't help.)

more ▼

asked Mar 24 '10 at 06:08 AM in Default

Jeremy H 1 gravatar image

Jeremy H 1
21 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Add the users to a domain group (using Active Directory), and then map that to a SQL login.

Assign your database permission to that SQL login.

more ▼

answered Mar 24 '10 at 07:23 AM

Kev Riley gravatar image

Kev Riley ♦♦
46.1k 38 43 69

+1 - AD groups are far and away my preference.

Mar 24 '10 at 07:47 AM Fatherjack ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1835
x1601
x145
x14

asked: Mar 24 '10 at 06:08 AM

Seen: 1519 times

Last Updated: Mar 25 '10 at 08:14 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.