Ask a Question related to ASP.NET Security, Design and Development.
-
Charlie Dison #1
Forms based security
Hi there,
In forms based security do I have to arrange pages into subdirectories
in order to secure them? I want the public to access my home page and
public content but want to restrict other content only to those for whom
I've granted a userid. Seems like I must organize all the private content
into one or more subdirectories. My problem is that I have some content
that should be accessible to both and I hate to have to specify directory
names when redirecting. Is there something that I can place in the load
event of each page that checks to see if the user has been authenticated
(checks for the cookie that would have been created)
Charlie Dison Guest
-
Forms-Based Security below Application Level
If I have a site where I want to use Forms-Based security but only on one or two SUB-directories of the Application root, I'm confused about how... -
Reg Role BAsed security..
Hi All.. Can any body detail out the basic diff/advatages/disadvantage over acheiving the role based security and the same thing in case of... -
Forms-based Authentication
HI I'm using Forms-based Authentication and trying out the example from the book: "ASP.NET Professional Secrets" after downloading the c# code... -
Security Based on NT Groups
You can disable anonymous access to the site so the users have to log in (can be automatic in an intranet environment so users don't have to enter... -
[MSFT] #2
RE: Forms based security
Hi Charlie,
To get the form authentication cookie, you may get the cookie name from:
FormsAuthentication.FormsCookieName
However, the cookie is encrypted, and we cannot get its actual value.
Regarding the issue, since the content are accessible to both of
Authenticated user and others, you can just leave the content public. Is
this right?
If you have private and public content on a same web form, you may consider
following work around:
When perform form authentication, you can add a cookie by yourself,
indcating the user has been authenticated. And then, arrange pages based
on this cookie value.
Hope this help,
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
[MSFT] Guest
-
ranganh #3
RE: Forms based security
Dear Charlie,
You don't need to arrange the authenticated pages inside a folder. You can specify the pages (say if they are minimum 5 pages etc.,) using location path. in that, you can also specify to allow the users, for whom you gave an userid. the following illustration shows the same:-
<location path="ProtectedPage1.aspx">
<system.web>
<authorization>
<allow users="UserId" />
<deny users="*" />
</authorization>
</system.web>
</location>
the above, would allow users with the above userid (whatever you give) and will deny all other users (anonymous and logged in).
however, in case you want to allow users with above userid as well as their own userid (logged in), change the <deny users="?" />. this will restrict only people
who are not logged in.
To check whether the user is logged in, use
if(User.Identity.IsAuthenticated)
{
}
to get the User's Id, use
User.Identity.Name
hope it helps.
"Charlie Dison" wrote:
> Hi there,
> In forms based security do I have to arrange pages into subdirectories
> in order to secure them? I want the public to access my home page and
> public content but want to restrict other content only to those for whom
> I've granted a userid. Seems like I must organize all the private content
> into one or more subdirectories. My problem is that I have some content
> that should be accessible to both and I hate to have to specify directory
> names when redirecting. Is there something that I can place in the load
> event of each page that checks to see if the user has been authenticated
> (checks for the cookie that would have been created)
>
>
>
>
>ranganh Guest
-
Charlie Dison #4
Re: Forms based security
Ok. that helps. Thanks
"ranganh" <ranganh@discussions.microsoft.com> wrote in message
news:985ABE3F-3E97-4557-93E8-1EDE5C89D06F@microsoft.com...can specify the pages (say if they are minimum 5 pages etc.,) using location> Dear Charlie,
>
> You don't need to arrange the authenticated pages inside a folder. You
path. in that, you can also specify to allow the users, for whom you gave
an userid. the following illustration shows the same:-will deny all other users (anonymous and logged in).>
> <location path="ProtectedPage1.aspx">
> <system.web>
> <authorization>
> <allow users="UserId" />
> <deny users="*" />
> </authorization>
> </system.web>
> </location>
>
> the above, would allow users with the above userid (whatever you give) andtheir own userid (logged in), change the <deny users="?" />. this will>
> however, in case you want to allow users with above userid as well as
restrict only peoplesubdirectories> who are not logged in.
>
> To check whether the user is logged in, use
>
> if(User.Identity.IsAuthenticated)
> {
>
> }
>
> to get the User's Id, use
>
> User.Identity.Name
>
> hope it helps.
>
> "Charlie Dison" wrote:
>> > Hi there,
> > In forms based security do I have to arrange pages intocontent> > in order to secure them? I want the public to access my home page and
> > public content but want to restrict other content only to those for whom
> > I've granted a userid. Seems like I must organize all the privatedirectory> > into one or more subdirectories. My problem is that I have some content
> > that should be accessible to both and I hate to have to specify>> > names when redirecting. Is there something that I can place in the load
> > event of each page that checks to see if the user has been authenticated
> > (checks for the cookie that would have been created)
> >
> >
> >
> >
> >
Charlie Dison Guest
-
Charlie Dison #5
Re: Forms based security
Ok. that helps. Thanks
"[MSFT]" <lukezhan@online.microsoft.com> wrote in message
news:X82wmA0VEHA.692@cpmsftngxa10.phx.gbl...consider> Hi Charlie,
>
> To get the form authentication cookie, you may get the cookie name from:
>
> FormsAuthentication.FormsCookieName
>
> However, the cookie is encrypted, and we cannot get its actual value.
>
> Regarding the issue, since the content are accessible to both of
> Authenticated user and others, you can just leave the content public. Is
> this right?
>
> If you have private and public content on a same web form, you may> following work around:
>
> When perform form authentication, you can add a cookie by yourself,
> indcating the user has been authenticated. And then, arrange pages based
> on this cookie value.
>
> Hope this help,
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
Charlie Dison Guest



Reply With Quote

