Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 24th, 2008, 01:48 PM
Authorized User
Join Date: May 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default forms authentication with two login pages

Got another question for someone with more experience. I have a web app that has a subfolder (/subfolderA) requiring a login page with forms authentication and roles. Goes against a custom sql2005 database for authentication and that's working fine.

But, I have another subfolder (/subfolderB) that requires its own login that goes against a different sql2005 database for authentication - one having nothing to do with the other.

When I tried to put a separate webconfig file in /subfolderB, it required that the subfolder be a separate app. That meant that references to MasterPages, images, css files, custom-menu code, etc., be in /subfolderB. That seems terribly wasteful and not a really good design option...

Does anyone know a way in the original webconfig to have two separate login page references, or is there a better way to do this? It's really not an option to have one login since the two departments insist on having their own wording on the login page.

Could I do something like look at the referring url and if it contains /subfolderB, redirect to the other login page? Or, what would you (anyone) suggest in a situation like this.

Many thanks.
Reply With Quote
  #2 (permalink)  
Old March 24th, 2008, 11:01 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Your approach may be the best.

No, you can not have two login pages for a single application. That is configured at the application level. If you can somehow identify the users by either a start page (maybe a link to your app from an internal website), IP address (specific or a range if your have a segmented network) or some other means, then you could determine what login page they will see.

Also, you could use the same login page for the functionality by just change the text the user sees as needed.

If you expect people to bookmark the page, you might consider dropping a cookie that identifies them for future visits. You could set a precedence that there always need to be a cookie identifying the user's department in order for the login page to show the login. If the login page doesn't find a cookie, it could first prompt the user to select their department. Then your set the cookie and show the login. Department specific landing pages could do this automatically so they needn't be prompted.

Reply With Quote
  #3 (permalink)  
Old March 25th, 2008, 08:09 AM
Authorized User
Join Date: May 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

Once again, thank you. It gives me a clearer understanding of what's possible. I'll consider your suggestions and go from here.
Reply With Quote

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
How windows NET authentication done in ASP pages lakshmy_raj Classic ASP Basics 1 October 20th, 2004 02:28 AM
Form authentication & multiple login pages duydp ASP.NET 1.0 and 1.1 Professional 2 September 14th, 2004 12:18 PM

All times are GMT -4. The time now is 02:14 PM.

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