Forum Moderators: open

Message Too Old, No Replies

Can't get site to let me in

         

andrewsmd

4:26 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We have an existing site that I copied all of its contents and put them on a development server. Now whenever I try to access the site it pops up with a generic login box. I have it set in IIS to use my credentials but it's no good. We do have a private side for login but that is in another folder. Here is the main web.config file also. Any ideas why I am getting this error

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="connect" value="Provider=Microsoft.Jet.OleDb.4.0;data source=../db/nsra.mdb;" />
<add key="conferencePayee" value="nsra@nereads.org" />
<!-- fee to become nsra member-->
<add key="registrationFee" value="25" />
<!-- fee to register for conference late -->
<add key="lateregistrationFee" value="25" />
<add key="sendfrom" value="nsra@nereads.org" />
<add key="mailhost" value="smtp01.intellicomweb.com" />

</appSettings>
<connectionStrings>
<add name="connect" connectionString="Provider=Microsoft.Jet.OleDb.4.0;data source=../db/nsra.mdb;" />
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode= "Forms">
<forms name=".ASPXAUTH" loginUrl="login.aspx" />
</authentication>

<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

marcel

4:53 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have authentication set to the following:
<authentication mode= "Forms">

but you state that you have IIS setup to use your credentials. You could either set Authentication Mode to windows, or remove the node altogether.

If you want both Forms and Windows Authentication, you can look into Mixed Mode Authentication [google.nl]

andrewsmd

6:13 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am new to all of this so bear with me. I need authentication mode forms for the website itself. However, any directory access from the server needs to be my credentials. Where in IIS do I have it set to use my credentials that I shouldn't? Thanks,

marcel

6:25 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure if I understand the situation correctly, but is Identity Impersonation [msdn.microsoft.com] an option for directory access?

andrewsmd

6:36 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm probably not explaining it right. When I first set this up, I was getting a 500 error. I went into event viewer and saw I was getting a error requesting a directory based on the permissions. It was using IIS_USR so I went into the properties of the website and went to the home directory and click connect as... I then checked always use authenticated users credentials and I get the login box now. Should I set that to something else.

marcel

6:59 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oh, I see, I completely misunderstood :).

An ASP.Net (version 2 or higher) uses the Network Service Account, if you give this account access to the directory you should no longer receive the permission error.

Edit - to set the permissions, right-click the folder (or file), choose properties, tab security and add the Network Service account. Then you can set the desired permissions.

andrewsmd

7:15 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not receiving the permissions error. I know it is something in my asp code because I have all of the permissions and properties in iis set the exact same as another development site that works fine. Any other suggestions? I appreciate your help.

marcel

7:24 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you set the website back to IIS_USR (unchecking always use authenticated users credentials)? and then set permissions for the Network Service user?

Maybe we should backtrack, what is the exact error/message you are receiving now?

andrewsmd

7:43 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I now have all of the permissions set to the exact same things that another site in iis has. The other site works, so in theory, so should this one. I am still getting a popup box that says Authentication required. Enter username and password for http://example.com. It shouldn't have that at all. It should just go to the default.aspx page. Although I do notice if I hit cancel it goes to http://example.com/private/default.aspx
private/default is where you would go if you had logged in but you should be logging in from the login.aspx page, not a pop up. It also gives me this error on that page.
Server Error in '/' Application.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

Once again, it should be going to default.aspx anyways. Any other ideas? Thanks,

andrewsmd

7:46 pm on Jul 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is something else that is funny. If I copy this entire directory to my local machine and run it from VS 2008 it works but still takes me to
[localhost:55555...]

That is the login page with the redirect url being private/default.aspx. It should just go to the default.aspx page. I can work with it on my machine and mirror the changes on the server if need be. You know, for all of the neat plugins and gui based development .net has, it's times like this that I miss developing in php. Any thoughts?

marcel

5:00 am on Jul 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am still getting a popup box that says Authentication required.

It looks like you still have anonymous authentication disabled for your website in IIS.

It seems to me that there are more issues than just permissions here, I have no experience with multiple web.configs in a solution as you describe here [webmasterworld.com]. It might be an idea to have another windows developer walk through the steps together with you to see if you might be overlooking something.

Or hopefully someone else will come by here with a better idea :)

andrewsmd

1:32 pm on Jul 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is, the only developer here is me. Any big projects we do, I manage and outsource to India. I'm pretty sure my multiple web.config files are fine because I've done that before. It's when you use the asp.net security tool in visual studio to grant access to folders based on members. Thanks for the help though. I have a workaround for now, running it locally on my machine.