Re: how to update context.user without postback ...ing



From FormsAuthenticationModule.cs source code line 140 :

////////////////////////////////////////////////////////////
// Step 6: Create a user object for the ticket
e.Context.SetPrincipalNoDemand(new GenericPrincipal(new
FormsIdentity(ticket2), new String[0]));


SetPrincipalNoDemand is a non public function,
and Context.User is read only ....

Any other idea ?

--
____________________
http://www.softlion.com/
Web tools and games

"Dominick Baier" <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans
le message de news: 8e6a913a1bcf38ca393aad7cce20@xxxxxxxxxxxxxxxxxxxxx
Context.User gets populated after the postback by the formsauthentication
module. If you don't need a postback -set Context.User yourself.

Source code is available. As all the ASP.NET code is. Just google.

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications
(http://www.microsoft.com/mspress/books/9989.asp)

Hi,
I'm using form authentication in a user control with fires an
onSignedOn
event to registered page controls,
so there is no need to postback a second time to reflect changes.
It seems the Context.User.Identity stays a GenericIdentity object even
after calling FormsAuthentication.SetAuthCookie, and there is no
method in the FormsAuthentication class to do that.

Is the source code for FormsAuthentication class available ? Any
workaround without postbacking ?

Thanks.
___________________
http://www.softlion.com/
Web tools and games




.



Relevant Pages

  • Re: how to update context.user without postback ...ing
    ... There is a public set which calls SetPrincipalNoDemand. ... If you don't need a postback -set Context.User yourself. ... Is the source code for FormsAuthentication class available? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: how to update context.user without postback ...ing
    ... Context.User gets populated after the postback by the formsauthentication module. ... Is the source code for FormsAuthentication class available? ...
    (microsoft.public.dotnet.framework.aspnet.security)