Link to home
Start Free TrialLog in
Avatar of designaire
designaireFlag for United States of America

asked on

asp.net login configuation

I'm totally confused. I used the asp.net configuration to set up users and passwords. It works correctly in visual studio but when I transferred it on a server it didn't work. The IT assistant said that there were no users names and passwords in the config file. I've looked this up on the web and in this website and didn't understand anything I saw. Do I add the users and passwords in this config file? Why do they have a asp.net configuration set up if you have to write code anyway? I only need 2 users and passwords to get into one folder with 2 files in it. What's the best way to go about this? Right now I have 2 users with password that have the roles admin.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <allow roles="admin" />
            <deny users="*" />
        </authorization>
    </system.web>
</configuration>

Open in new window

Avatar of GiftsonDJohn
GiftsonDJohn
Flag of India image

Hi,

According to your configuration only the users with role admin will have access to your site. Have you copied the ASPNETDB.MDB from app_data folder to the web server? This is where the users and roles details will be saved.
Avatar of designaire

ASKER

Yes, I get the login but nothing happens when I try to login. The guy at the  hosting service acted like I should have the user names in the config file. Maybe I should set it up again and transfer it again.
The configuration is based on the Application name what you have created on the client. If you have changed your application name while deploying into the server then you have to reconfigure the application configuration.

Try this. Open Aspnetdb.mdb in Visual Studio Server Explorer and open and see the table aspnet_Applications what value it has.
User names in the web.config file is not required. It will be configured inside ASPNETDB.MDB file along with the role
I have ASPNETDB.MDF with aspnetdb_log.ldf ...is that correct? I can go into tables and aspnet_applications but I don't know what I'm looking for.

When I log-in to the page it says the server www.domainname.com requires a username and password. Is that from the authentication I set up or is it from the web server?
It is correct.

No. it seems like permission settings are not correct in the file system. Check the security settings in the web server folders (probaby inside C:\Inetpub\wwwroot).
Do you mean my hard drive or the server of the hosting company? I can't find the Inetpub\wwwroot. I just did a search. I'm using Visual Studio but I guess you know that.
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.
Yes. on the webserver, the security settings on the files might not be correct. If any misleading with Asp.Net configuration it will say "Access Denied" message clearly. If it prompts for user name and password then definitely the problem is with the web server end.

What happends if you cancel out of authentication dialog. Is it saying "Access Denied due to invalid server configurations?" IIS message or Asp.Net error message
Yes. it is correct. The problem is with Server file system security credentials. Need to set the security credentials accordingly
What should I ask them to do?  I'll have to call tomorrow. I already called and he said I didn't have the users and password in the config file. Maybe I'll get somebody else when I call.
ASKER CERTIFIED SOLUTION
Avatar of GiftsonDJohn
GiftsonDJohn
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial