Database Access and trusted connections

  • Thread starter Shawn H. Mesiatowsky
  • Start date
S

Shawn H. Mesiatowsky

I have a strange problem here. I have my development computer with IIS
installed, and we have a SQL server as well on a windows 2000 server. both
are members of a domain. I have restricted access to my web app using NTFS
ACL's and have disabled anonymous logon and enabled windows authentication.
So when a user logons on to a computer and they use there web browser, they
are not prompted to logon to the intranet web app I am building. All seems
to work except for Database Access. When any user logs onto my development
computer, they have no trouble getting database access (which is located on
another computer), but when they log into any other computer, they do not
have database access. in my code, I specify the connection string to use
trusted connections so it uses there current credentials. When a user is
logged into another computer and views a page that access's the database I
get the error, "NT AUTHORITY\ANONYMOUS LOGON DENIED" however, the user is
logged on, and if I display there logon with this command :
User.Identity.Name

it definitly shows the user is logged on the web site with there curent
credintials. Am I missing something here in the code? here is my code by the
way( not that the code is the problem because I am not really doing
anything, just trying to connect)



SqlConnection conPubs = new
SqlConnection("Trusted_connection=yes;Server=mysqlserver;Database=mydatabase");

SqlCommand cmdSql;

SqlDataReader dtrUsers;

cmdSql = new SqlCommand("SELECT * FROM Users, conPubs);

conPubs.Open();

dtrUsers = cmdSql.ExecuteReader();
 
W

WJ

Make sure that the domain users are also defined in the MS/SQL 2000 User
object and that your users are truly authenticated by your domain (where the
SQL box is a member of).

John
 
S

Shawn H. Mesiatowsky

Yes all perms are set correctly on both the web server and sql server. one
thing I am not to (but pretty sure) is that the user is being authenticated.
I have a label and on the page_load event I set the text of the label to
User.Identity.Name and it shows the name of the user logged on. So I am
pretty sure that the user is using his credentials and is not being logged
on anonymously (and I have disabled that anywayz. Thanks for your help
 
W

WJ

Shawn H. Mesiatowsky said:
Yes all perms are set correctly on both the web server and sql server. one
...
I specify the connection string to use trusted connections so it uses
there current credentials. When a user is logged into another computer and
views a page that access's the database I get the error, "NT
AUTHORITY\ANONYMOUS LOGON DENIED"

Sounds like your user is not authenticated to your Domain because SQL server
was sent "ANONYMOUS LOGON", not your user logon (per your 1st post).

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top