Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forms authentication for certain pages

Reply
Thread Tools

Forms authentication for certain pages

 
 
=?Utf-8?B?TWF4IFR1cmF2YW5p?=
Guest
Posts: n/a
 
      02-06-2007
Hi,

Is there any way I can cause a login page to appear, using Forms
authentication of course, when access a particular page only. In my case, I
am building a site for rental properties. There are a group of files ( HTML,
ASPX files ) that are freely publicly accessable. There are certain pages
however that my client will use to update their listings and images. I would
like those pages ONLY to be redirected to the login page but NOT the publicly
accessible files. Is there a way to target URL redirection using forms
authentication for certain files that you specify.

Thanks,

Max
 
Reply With Quote
 
 
 
 
news-server.maine.rr.com
Guest
Posts: n/a
 
      02-06-2007

"Max Turavani" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Is there any way I can cause a login page to appear, using Forms
> authentication of course, when access a particular page only. In my case,
> I
> am building a site for rental properties. There are a group of files (
> HTML,
> ASPX files ) that are freely publicly accessable. There are certain pages
> however that my client will use to update their listings and images. I
> would
> like those pages ONLY to be redirected to the login page but NOT the
> publicly
> accessible files. Is there a way to target URL redirection using forms
> authentication for certain files that you specify.
>
> Thanks,
>
> Max


Hi Max,

Just put all the files you want to protect under their own directory, and in
that directory add another web.config file specifying allow and deny.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      02-06-2007
Hi Max,

In addition to that, you can use location element:

<system.web>

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
</authentication>

<!-- allow everyone too see all pages -->
<authorization>
<allow users="*"/>
</authorization>

</system.web>

<!-- restrict access to few confidential pages -->
<location path="confidentialUpdatePage1.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

<location path="confidentialUpdatePage2.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

--
Milosz


"news-server.maine.rr.com" wrote:

>
> "Max Turavani" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > Is there any way I can cause a login page to appear, using Forms
> > authentication of course, when access a particular page only. In my case,
> > I
> > am building a site for rental properties. There are a group of files (
> > HTML,
> > ASPX files ) that are freely publicly accessable. There are certain pages
> > however that my client will use to update their listings and images. I
> > would
> > like those pages ONLY to be redirected to the login page but NOT the
> > publicly
> > accessible files. Is there a way to target URL redirection using forms
> > authentication for certain files that you specify.
> >
> > Thanks,
> >
> > Max

>
> Hi Max,
>
> Just put all the files you want to protect under their own directory, and in
> that directory add another web.config file specifying allow and deny.
>
>
>
>

 
Reply With Quote
 
=?Utf-8?B?TWF4IFR1cmF2YW5p?=
Guest
Posts: n/a
 
      02-06-2007
Thanks everyone for your responses !!!
I used the location tag option and it worked like a charm !!!!

Thanks again !!!

"Milosz Skalecki [MCAD]" wrote:

> Hi Max,
>
> In addition to that, you can use location element:
>
> <system.web>
>
> <authentication mode="Forms">
> <forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
> </authentication>
>
> <!-- allow everyone too see all pages -->
> <authorization>
> <allow users="*"/>
> </authorization>
>
> </system.web>
>
> <!-- restrict access to few confidential pages -->
> <location path="confidentialUpdatePage1.aspx">
> <system.web>
> <authorization>
> <deny users="?"/>
> </authorization>
> </system.web>
> </location>
>
> <location path="confidentialUpdatePage2.aspx">
> <system.web>
> <authorization>
> <deny users="?"/>
> </authorization>
> </system.web>
> </location>
>
> --
> Milosz
>
>
> "news-server.maine.rr.com" wrote:
>
> >
> > "Max Turavani" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi,
> > >
> > > Is there any way I can cause a login page to appear, using Forms
> > > authentication of course, when access a particular page only. In my case,
> > > I
> > > am building a site for rental properties. There are a group of files (
> > > HTML,
> > > ASPX files ) that are freely publicly accessable. There are certain pages
> > > however that my client will use to update their listings and images. I
> > > would
> > > like those pages ONLY to be redirected to the login page but NOT the
> > > publicly
> > > accessible files. Is there a way to target URL redirection using forms
> > > authentication for certain files that you specify.
> > >
> > > Thanks,
> > >
> > > Max

> >
> > Hi Max,
> >
> > Just put all the files you want to protect under their own directory, and in
> > that directory add another web.config file specifying allow and deny.
> >
> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best practices for using forms authentication and security in a hosted env (was: Re: Using a Forms authentication in a shared hosting environment) JEFF ASP .Net 1 11-12-2007 07:00 PM
Forms authentication - restricting certain pages Paul Aspinall ASP .Net 1 10-01-2006 08:47 PM
Forms Authentication - Supress displaying the login page for certain web pages Felix Wafytech ASP .Net Security 2 07-19-2006 03:04 AM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM



Advertisments