Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Role based security question

Reply
Thread Tools

Role based security question

 
 
clsmith66
Guest
Posts: n/a
 
      01-19-2006
I am a fairly new developer and need some help setting up some security for a
site I am helping to build. The site should allow any one who goes there to
view and use some basic pages, but should also give the option of signing in
and then being redirected to the appropriate area of the application. I have
found some code to implement role base security (which is exactly what I'm
looking for) using Forms Authentication, but doesn't that force every one
accessing the web site to sign in? How can I restrict access to portions of
the site unless the appropriate login is provided, but not require a login
for the site as a whole?

Any help would be greatly appreciated.

Chris
 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      01-19-2006
hi,

partition your site in public and authenticated areas.

use a location element to restrict access to the authenticated area,

e.g. by restricting to specific roles

<location path="autharea">
<system.web>
<authorization>
<allow roles="Role1, Role2" />
<deny users="*" />
</authorization>
</system.web>

or generally deyning un-authenticated access

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

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> I am a fairly new developer and need some help setting up some
> security for a site I am helping to build. The site should allow any
> one who goes there to view and use some basic pages, but should also
> give the option of signing in and then being redirected to the
> appropriate area of the application. I have found some code to
> implement role base security (which is exactly what I'm looking for)
> using Forms Authentication, but doesn't that force every one accessing
> the web site to sign in? How can I restrict access to portions of the
> site unless the appropriate login is provided, but not require a login
> for the site as a whole?
>
> Any help would be greatly appreciated.
>
> Chris
>



 
Reply With Quote
 
 
 
 
clsmith66
Guest
Posts: n/a
 
      01-19-2006
Thank you for your rapid response.

If I set the public side to allow anonymous user, will the Forms
Authentication be skipped? Once I have a user loged in, how do I direct them
to a "start" page based on their role? I need administrators to go to one
section, and registered customers to go somewhere else.

Chris

"Dominick Baier [DevelopMentor]" wrote:

> hi,
>
> partition your site in public and authenticated areas.
>
> use a location element to restrict access to the authenticated area,
>
> e.g. by restricting to specific roles
>
> <location path="autharea">
> <system.web>
> <authorization>
> <allow roles="Role1, Role2" />
> <deny users="*" />
> </authorization>
> </system.web>
>
> or generally deyning un-authenticated access
>
> <location path="autharea">
> <system.web>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
> > I am a fairly new developer and need some help setting up some
> > security for a site I am helping to build. The site should allow any
> > one who goes there to view and use some basic pages, but should also
> > give the option of signing in and then being redirected to the
> > appropriate area of the application. I have found some code to
> > implement role base security (which is exactly what I'm looking for)
> > using Forms Authentication, but doesn't that force every one accessing
> > the web site to sign in? How can I restrict access to portions of the
> > site unless the appropriate login is provided, but not require a login
> > for the site as a whole?
> >
> > Any help would be greatly appreciated.
> >
> > Chris
> >

>
>
>

 
Reply With Quote
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      01-19-2006
hi,

you could do that in your login page - query the roles and do a response
redirect..

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> Thank you for your rapid response.
>
> If I set the public side to allow anonymous user, will the Forms
> Authentication be skipped? Once I have a user loged in, how do I
> direct them to a "start" page based on their role? I need
> administrators to go to one section, and registered customers to go
> somewhere else.
>
> Chris
>
> "Dominick Baier [DevelopMentor]" wrote:
>
>> hi,
>>
>> partition your site in public and authenticated areas.
>>
>> use a location element to restrict access to the authenticated area,
>>
>> e.g. by restricting to specific roles
>>
>> <location path="autharea">
>> <system.web>
>> <authorization>
>> <allow roles="Role1, Role2" />
>> <deny users="*" />
>> </authorization>
>> </system.web>
>> or generally deyning un-authenticated access
>>
>> <location path="autharea">
>> <system.web>
>> <authorization>
>> <deny users="?" />
>> </authorization>
>> </system.web>
>> ---------------------------------------
>> Dominick Baier - DevelopMentor
>> http://www.leastprivilege.com
>>> I am a fairly new developer and need some help setting up some
>>> security for a site I am helping to build. The site should allow
>>> any one who goes there to view and use some basic pages, but should
>>> also give the option of signing in and then being redirected to the
>>> appropriate area of the application. I have found some code to
>>> implement role base security (which is exactly what I'm looking for)
>>> using Forms Authentication, but doesn't that force every one
>>> accessing the web site to sign in? How can I restrict access to
>>> portions of the site unless the appropriate login is provided, but
>>> not require a login for the site as a whole?
>>>
>>> Any help would be greatly appreciated.
>>>
>>> Chris
>>>



 
Reply With Quote
 
clsmith66
Guest
Posts: n/a
 
      01-19-2006
Thanks for your help. Acutally thought for a minute and think I answered my
own questions.

Chris

"Dominick Baier [DevelopMentor]" wrote:

> hi,
>
> partition your site in public and authenticated areas.
>
> use a location element to restrict access to the authenticated area,
>
> e.g. by restricting to specific roles
>
> <location path="autharea">
> <system.web>
> <authorization>
> <allow roles="Role1, Role2" />
> <deny users="*" />
> </authorization>
> </system.web>
>
> or generally deyning un-authenticated access
>
> <location path="autharea">
> <system.web>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
> > I am a fairly new developer and need some help setting up some
> > security for a site I am helping to build. The site should allow any
> > one who goes there to view and use some basic pages, but should also
> > give the option of signing in and then being redirected to the
> > appropriate area of the application. I have found some code to
> > implement role base security (which is exactly what I'm looking for)
> > using Forms Authentication, but doesn't that force every one accessing
> > the web site to sign in? How can I restrict access to portions of the
> > site unless the appropriate login is provided, but not require a login
> > for the site as a whole?
> >
> > Any help would be greatly appreciated.
> >
> > Chris
> >

>
>
>

 
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
AzMan Role Based Security vs. ASP.NET Role Based Security Kursat ASP .Net Security 1 05-07-2007 01:33 PM
Role Based Security Question =?Utf-8?B?TWlrZSBMb2dhbg==?= ASP .Net 3 12-20-2004 02:54 AM
Role Based Security Question =?Utf-8?B?TWlrZSBMb2dhbg==?= ASP .Net 1 12-20-2004 12:57 AM
Role-Based Security: ACLs and Role Hierarchies Liet Kynes ASP .Net 0 11-26-2003 08:08 AM
Role-based security: Access the role of current user Jesper Stocholm ASP .Net 2 08-23-2003 06:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57