HighTechTalks DotNet Forums  

Put princicple object in Context (ASP.net)?

Dotnet Security microsoft.public.dotnet.security


Discuss Put princicple object in Context (ASP.net)? in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Frank J
 
Posts: n/a

Default Put princicple object in Context (ASP.net)? - 06-18-2004 , 06:31 PM






Is it a good practice by putting princicple object in Context?

Is it possible to spoof the Context.Current.User?

//code in global.asax
Sub Application_OnAuthenticateRequest(ByVal Source As Object, ByVal Details As EventArgs)
'Authentication code goes here.
myPrinciple = ...
Context.Current.User = myPrinciple
end sub

Reply With Quote
  #2  
Old   
Joe Kaplan \(MVP - ADSI\)
 
Posts: n/a

Default Re: Put princicple object in Context (ASP.net)? - 06-18-2004 , 11:33 PM






This is often done in order to implement a custom role-based security system
in your web application, so it is definitely considered good practice when
that is needed.

What do you mean by spoof in this context?

Joe K.

"Frank J" <FrankJ (AT) discussions (DOT) microsoft.com> wrote

Quote:
Is it a good practice by putting princicple object in Context?

Is it possible to spoof the Context.Current.User?

//code in global.asax
Sub Application_OnAuthenticateRequest(ByVal Source As Object, ByVal
Details As EventArgs)
'Authentication code goes here.
myPrinciple = ...
Context.Current.User = myPrinciple
end sub



Reply With Quote
  #3  
Old   
Joe Kaplan \(MVP - ADSI\)
 
Posts: n/a

Default Re: Put princicple object in Context (ASP.net)? - 06-21-2004 , 02:26 PM



Yes, this is possible. If you don't trust the code that your web
application is running, then you could definitely have a security problem.

The .NET code access security (CAS) system has a permission that allows
control of the principal to controlled. You use the SecurityPermission with
the ControlPrincipal flag. ASP.NET does have support for running web
applications in partial trust, so it should be possible to restrict which
code gets to control the principal if you want. I'm a little fuzzy on the
details though.

Joe K.

"Frank J" <FrankJ (AT) discussions (DOT) microsoft.com> wrote

Quote:
I don't know how iPrinciple is written. Since it exists in http context
and every page in a same request session can access it. It's possible that a
piece of code in any page can change the Context.User thus create security
problem.
Quote:
Frank

"Joe Kaplan (MVP - ADSI)" wrote:

This is often done in order to implement a custom role-based security
system
in your web application, so it is definitely considered good practice
when
that is needed.

What do you mean by spoof in this context?

Joe K.

"Frank J" <FrankJ (AT) discussions (DOT) microsoft.com> wrote in message
news:7922AA36-355C-4FBA-824C-26A955FD5A45 (AT) microsoft (DOT) com...
Is it a good practice by putting princicple object in Context?

Is it possible to spoof the Context.Current.User?

//code in global.asax
Sub Application_OnAuthenticateRequest(ByVal Source As Object, ByVal
Details As EventArgs)
'Authentication code goes here.
myPrinciple = ...
Context.Current.User = myPrinciple
end sub






Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.