473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP.Net/SQL Server Authentication

I'm not sure which newsgroup to post this in, so I'm putting it in the
general one. I am simply trying to get my ASP.Net application to connect to
a SQL database (on a different server) using an active directory account, NOT
the ASP.Net user account. So far, I have disabled the anonymous access for
the web site's directory security (in IIS), and I have ensured that I have
<authentication mode="Windows"/in my web.config file. In my SQL Server
connection string I have 'Integrated Security=true;'

I have tried passing the user account through the HTTPContext object, but
I'm still getting the error that says Login failed for user 'DOMAIN\SERVER$'.
It's still trying to authenticate using the server's ASP.Net user account,
despite the setting in IIS that tells it specifically not to do that.

I'm sure there is some combination of DB connection string, web.config
settings, and IIS settings that need to be in place in order to do this. I
by no means want to grant access to the DB for the ASP.Net user. Does anyone
know what I'm missing here?

TIA,
Mike
Jun 1 '07 #1
1 3359
The problem is that you do not know exactly which user account is running
your wep app. Once you know that, you 'd be able to give this account needed
access to the SQL Server.

You could do this to in your ASP.NET page to tell which user is ruing the
web app:

Add a label on the page

private void Page_Load(...)
{
Label1.Text=Context.User.Identity.Name
}

Disable anonymus access and set <authentication mode="Windows"/requires
the user to be authenticated. In this case, if the user log into the domain
from his computer, he is considered authenticated, so, the IIS does not need
user to submit his credential again when connect to the app. However, the
web app is still run in a user account by its configuration. By default, it
is ASPNET or NETWORK SERVICE on the servicec computer. If you wna the app
run under a domain account (in order to access the SQL Server on other
computer), you can impersonate the running account to a domain account, or
simply set <identity impersonate="true" />. In this case, the wep app runs
under the domain user account, whoever is accessing the app.
"mfm" <mf*@discussions.microsoft.comwrote in message
news:C8**********************************@microsof t.com...
I'm not sure which newsgroup to post this in, so I'm putting it in the
general one. I am simply trying to get my ASP.Net application to connect
to
a SQL database (on a different server) using an active directory account,
NOT
the ASP.Net user account. So far, I have disabled the anonymous access
for
the web site's directory security (in IIS), and I have ensured that I have
<authentication mode="Windows"/in my web.config file. In my SQL Server
connection string I have 'Integrated Security=true;'

I have tried passing the user account through the HTTPContext object, but
I'm still getting the error that says Login failed for user
'DOMAIN\SERVER$'.
It's still trying to authenticate using the server's ASP.Net user account,
despite the setting in IIS that tells it specifically not to do that.

I'm sure there is some combination of DB connection string, web.config
settings, and IIS settings that need to be in place in order to do this.
I
by no means want to grant access to the DB for the ASP.Net user. Does
anyone
know what I'm missing here?

TIA,
Mike

Jun 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dale zhang | last post by:
Hi, I write an asp.net web application. It has a “Contact Us” page, where users fill in their email, subject and text and hit send. Then the email will go to my hard coded yahoo email...
4
by: Ravikanth[MVP] | last post by:
Hi It is possible that IIS and SQL Server can reside on Seperate Machines and you can use Integrated Windows Authentication to connect. Ravikanth >-----Original Message-----
2
by: Lior Amar | last post by:
Hey All, Trying to understand why I can not get SQL server to trust my IIS server. I have two machines set up, 1 App and 1 DB, and I'm trying to validate the applications access to the DB server...
2
by: news.microsoft.com | last post by:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. I guess I get this because, my pages are hosted on WinXP IIS and the sql server is on Win2k3. ...
8
by: Nils Magnus Englund | last post by:
Hello, I am having trouble using Integrated Windows Authentication between our intranet server and our database server, both of which are on our local domain. Windows authentication works for...
7
by: Alice Wong | last post by:
I am setting up my Web ASP.net application to connect to Sql server using windows authentication. I set up IIS to have integrated windows authenication and sql to allow Windows authentication....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
4
by: Preben Zacho | last post by:
Hi there The scenario I got is this: I have created a Windows application in VS and I want to deploy it to another machine running Windows Vista. Since I have no control over this other machine,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.