Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localhost

Status
Not open for further replies.

HrvojeVd

Programmer
Jun 22, 2008
36
HR
I want to use my web page on localhost.
But I get an error: not authorized to view page.
In IIS i put authentication mode to Windows, but it doesn't work.
Is there anything else I should do?
 
you need to configure your website to use Windows Authentication and Impersonation. then set IIS to use Windows authentication.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
you'll need to provide more information at this point. the web config (remove passwords/usersnames) and the settings on IIS.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
In web.config i put:

<authentication mode="Windows"/>
<identity impersonate="true" />

and in iis I assigned Integrated authentication on properties of virtual directory that i use as localhost.
 
hmmm. that should do it. did you disable anonymous access as well? if not try disabling this.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
are you logged into a domain? i use this all the time at work without an issue. you may also want to raise this question in forum41. they would have more insight to the administration side of IIS.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
HrvojeVd, I was able to duplicate the null user error you are experiencing. here is my scenario:
windows authentication in web.config and IIS
impersonating user
I have a timer event that begins at application start. within this event I call the database

this is where the problem exists. impersonation applies to the HTTP context. But the timer doesn't run on an HTTP request. therefore I cannot use the user account to log into the database. The timer is running independent of any user account.

the same is true with other points in the asp.net pipeline: starting session, application start, application end (and there may be more). If you are trying to connect to the database at any one of these points you will get the null user error.

I hope this sheds some light on your issue.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top