Question

I have really silly problem but it's been a week and I can't move forward. I have small app that is protected by authentication. Everything works locally, you can log-in etc. On remote machine, you can't log-in, it tells you your login is not recognized. Now, I thought it might be db connection etc, so i made small test page that list asp_users table and by doing changes to users I can see both local and remote are seeing same table through that connection, why user authentication isn't working is beyond me.

To clarify, it is asp.net app and forms authentication, db connection is working based on test page I created that lists asp_users table.

It doesn't really report any error, just says 'Your login attempt was not successful. Please try again.' It must be something really simple and I am too frustrated now to see it, which is why I am asking for help. HELP ! :)

OK so I tried to post parts of web.config but it just isn't showing up. It is really basic config with connection string and membership and roles sections (no profile). So question would be how would you go about this, what would you check.

Thanks in advance for any constructive comments.

Zeljko

Was it helpful?

Solution

We had a somewhat similar situation in that while we could log in, the site refused to "Remember Me" when selected. It boiled down to making sure that both the Membership and Role providers pointed at the same resources. Yeah, that was a "Doh!" moment for me. :)

Are you trying to use SQLExpress on the remote server, or is it pointed at a full SQLServer instance? It's been my experience that most shared hosting environments aren't setup to allow the use an .MDF in the App_Data folder... Regardless, knowing this will point you in the right direction.

Here are a few things to try:

  1. Make sure your login id isn't locked out; it really may be as simple as that

  2. Make sure there's no security trimming on the folder that contains the login page

  3. Check the appropriate provider settings in the web.config file and make sure that

    • All the providers need to have the same value for the "Application" attribute

    • All the providers need use the same connection string and provider "set"

      • More than likely this is going to mean using the SqlMembershipProvider and SqlRoleProvider
      • If yours isn't a v3.5 app then you might have to add a reference to System.Web.Security. That's the namespace you actually need
    • If you're CERTAIN that your site can use SQLExpress, then try this with the AspNetMembershipProvider and AspNetRoleProvider

HTH!

OTHER TIPS

Do you have a domain? If you do not, then you would have to login as a user of the system where your asp.net app is running.

If you do have a domain, try logging in as

Domain_Name\UserName

Just throwing that one out there.

Its not clear what type of Authentication you are using but if it is Windows authentication then it could be that you are reading your logged in user from the local machine and the user doesn't exist on the remote.

If you have correctly implemented forms authentication, then it sounds like it could be a database connection issue and you should start troubleshooting there..

  • Perhaps start by trying to connect from sql management studio from the remote machine to the db (using the connection info in your web.config)

What are the Directory Security settings for IIS? Make sure settings are the same for the "Anonymous access and authentication control" dialog. An invalid setting here is the most likely cause of this particular error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top