Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2008, 08:25 AM
Registered User
 
Join Date: Sep 2008
Location: Austin, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logins stopped working after adding to web.config

Hey guys,

I added the RSS Toolkit to the site. It worked perfectly as far as displaying feeds, but now no one can login. The logins aren't passing authentication. The weird thing is that new accounts that have been created since then DO work. I feel it was something that was changed in the web.config.

Here are the entries that were added:

<system.web>
        <compilation debug="true">
            <assemblies>
                <add assembly="RssToolkit,Version=1.0.0.1,Culture=neutr al,PublicKeyToken=02e47a85b237026a"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>

            <buildProviders>
                <add extension=".rss" type="RssToolkit.RssBuildProvider,RssToolkit,Versi on=1.0.0.1,Culture=neutral,PublicKeyToken=02e47a85 b237026a"/>
                <add extension=".rssdl" type="RssToolkit.RssdlBuildProvider,RssToolkit,Ver sion=1.0.0.1,Culture=neutral,PublicKeyToken=02e47a 85b237026a"/>
            </buildProviders>
        </compilation>
    </system.web>

    <appSettings>
        <add key="defaultRssTtl" value="10"/>

    </appSettings>

    <system.net>
        <defaultProxy useDefaultCredentials="true"/>
    </system.net>


Any idea what would be causing this?
Thanks!

Link to RSS Toolkit: http://blogs.msdn.com/dmitryr/archiv...26/561200.aspx

  #2 (permalink)  
Old September 2nd, 2008, 09:46 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

It could have something to do with the RSS Toolkit, but I doubt it.

Check your aspnet_Applications table. I will bet anything you have more than one app in there. This would normally be caused by moving the application to a different server (i.e., from a test to a production server, or even maybe from the internal Cassini server to a virtual directory in IIS) and failing to specify an applicationName in your authentication config.


  #3 (permalink)  
Old September 2nd, 2008, 11:18 AM
Registered User
 
Join Date: Sep 2008
Location: Austin, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're right, there are two applications listed in there. Except that the correct App is named as the applicationName and the site has been working in the same environment (discountasp.net) for over a year with those same settings. I rolled back my web.config and all other pages I've made changes to in the last few weeks and it's still not authenticating users. This problem just came up over the weekend. All the hashes for the passwords and salts in the database are the same as they ever were so I'm having a hard time figuring out what is causing the problem. Also, the password retrieval isn't working either, you just get "We were unable to access your information. Please try again." after searching for the username.


  #4 (permalink)  
Old September 2nd, 2008, 12:08 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Quote:
quote:Originally posted by troyb
 You're right, there are two applications listed in there. Except that the correct App is named as the applicationName and the site has been working in the same environment (discountasp.net) for over a year with those same settings. I rolled back my web.config and all other pages I've made changes to in the last few weeks and it's still not authenticating users. This problem just came up over the weekend. All the hashes for the passwords and salts in the database are the same as they ever were so I'm having a hard time figuring out what is causing the problem. Also, the password retrieval isn't working either, you just get "We were unable to access your information. Please try again." after searching for the username.


It's likely that discountasp.net moved the app to a new server without your knowledge. I am pretty sure this is what is causing your problem.

Look at your <membership> section in web.config. I am willing to bet you do not have an applicationName= in there.

By failing to include an application name in your membership provider, ASP.NET has automatically set up an application name for each server this application has been run on. The problem with that is, that all logins set up on the old server will not work on the new server (and or course, logins set up on the new server won't work if you move it back).

(This is not your fault. You should always indicate an applicationName for all providers, but the book fails to follow this best practice. If you had done that, this wouldn't have happened.)

What you need to do is to fix this is to open aspnet_Users and aspnet_Applications, and try to figure out what application name and id was in use when the old logins were created. You can do this by looking for an "old" login, and matching up the ApplicationID field with the ApplicationID field in the aspnet_Applications table. This will give you your original application id and name.

Then, you need to go to web.config and put the original application name you found in the Membership provider: applicationName="/blahblah". That will assure that new logins created from that point forward will work.

Finally, you have to migrate all the "new" logins to work with the original application id. Copy the original application id to the clipboard, then by hand find each "new" user in aspnet_Users and the corresponding entry in aspnet_Membership, and paste the original application id from the clipboard to the ApplicationId field in both tables for each record you need to "fix". This is kind of tedious, so hopefully you won't have too many.

Hope this helps...

Lee

  #5 (permalink)  
Old September 2nd, 2008, 12:37 PM
Registered User
 
Join Date: Sep 2008
Location: Austin, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the detailed help Lee!

I've got a few accounts back to normal, now I've just gotta crunch the last 80 or so and we're good to go. Thanks again!

  #6 (permalink)  
Old September 2nd, 2008, 03:34 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Yes, you're welcome. I discovered this one the hard way, just like everyone else!

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intellisence stopped working beddowsm Visual Studio 2008 3 September 5th, 2008 12:32 PM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
date function stopped working in report Loralee Access 6 December 8th, 2005 07:11 PM
Help... Smtp.Mail.Send stopped working funtent General .NET 1 October 27th, 2004 07:26 AM
Intellisense stopped working in InterDev 6 riga1966 Classic ASP Professional 3 June 1st, 2004 05:31 AM



All times are GMT -4. The time now is 05:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.