Context looses the ISitePrincipal...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I implemented a classic FormsAuthentication. I created my own classes that implement ISItePrincipal and ISiteIdentity. When the login is succesfull I do something like this:

newPrincipal = new CustomSitePrincipal(.....);
this.Context.User = newPrincipal;
FormsAuthetication.SetAuthCookie(...);
Response.Redirect("\Default.aspx");

In default.aspx all works fine, the Context.User.Identity.IsAuthenticated is true, but, the Context.User is no longer of CustomSitePrincipal type, instead it is a default FormssomethingPrincipal. Why does my context loose the SitePrincipal?? I need to persist it in this way so I can pull some information from it and display it on the page...

PS: I know this should work as I saw it work before, I just don't know what I am missing....

Any ideas?
Thank you,
Andrew.
 
In Global.asax add code for AcquireRequestState and then set your generic
principal to your custom principal.
--
Joe Fallon



Andrew Parks said:
Hello, I implemented a classic FormsAuthentication. I created my own
classes that implement ISItePrincipal and ISiteIdentity. When the login is
succesfull I do something like this:
newPrincipal = new CustomSitePrincipal(.....);
this.Context.User = newPrincipal;
FormsAuthetication.SetAuthCookie(...);
Response.Redirect("\Default.aspx");

In default.aspx all works fine, the Context.User.Identity.IsAuthenticated
is true, but, the Context.User is no longer of CustomSitePrincipal type,
instead it is a default FormssomethingPrincipal. Why does my context loose
the SitePrincipal?? I need to persist it in this way so I can pull some
information from it and display it on the page...
 
Back
Top