Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiple login and membership provider

Posted on 2009-05-14
7
Medium Priority
?
264 Views
Last Modified: 2012-05-07
Hi all

Let say if I have 2 folders:

/admin
/public

Each folder I have to put the login.aspx ... now how do I control that if someone accessing through /admin then every page that located under admin folder will be redirected to /admin/login.aspx if the user trying to bypass the login?

Or similar thing if someone through /public then every page that located under public folder will be redirected to /public/login.aspx if the user trying to bypass the login?

At the moment I put below which works ok If you are accessing through /admin folder.

Thanks
<authentication mode="Forms">
      <forms loginUrl="~/Admin/Login.aspx" defaultUrl="~/Admin/default.aspx" />
    </authentication>
    <authorization>
      <deny users="?"/>
      <allow users="*"/>
    </authorization>

Open in new window

0
Comment
Question by:dewacorp_alliances
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 9

Expert Comment

by:tetorvik
ID: 24392451
You can have a folder specifig web.config files where you can override the settings in a higher-level Web.config file.
This provides a way have different configurations in different folders in a single ASP.NET application.

Hope this helps!
0
 

Author Comment

by:dewacorp_alliances
ID: 24392479
Hi tetorvik

Ok you need to have 2 virtual directories then ... one is for Admin and the other one is Public? In VS 2005 how do I setup this things? Do I need to create 2 web applications?

Thanks
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24392571
You can simply add Public and Admin folders into your project. In the folders you should have the pages specifig to admin/public and the specifig configuration file (web.config) for both folders.

So only one application is required.

 
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:DreamsTech
ID: 24393502
I would say ,the guidelines says u shud have only one login Page ,and u need to set up the roles of the user based on which he can browse to only those pages to which he has access.


<forms loginUrl="~/LoginPage/Login.aspx" defaultUrl="~/Pages/default.aspx" />

Open in new window

0
 

Author Comment

by:dewacorp_alliances
ID: 24400714
Hi Tetorvik

I did try your suggesting by using 2 folder on the same project and put each web.config on those folders but an eror comes out and also crate another project on for admin and one for public ... and it the same error:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.      
0
 
LVL 9

Accepted Solution

by:
tetorvik earned 1000 total points
ID: 24401261
You were right. it seems that there are certain properties in web.config which cannot be set to override the parent web.config (such as authenitication and session sections) unless the sub-directory is also configured as an application. I am sorry I wasn't aware of this limitation and had only been using multiple web.configs in other context.

Sorry for the trouble caused!

http://geekswithblogs.net/ranganh/archive/2005/04/25/37609.aspx


0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question