genericprincipal

Extend System.Web.HttpContext.User

I would like to extend the System.Web.HttpContext.User object (ASP.NET/VB.NET) so that it contains other fields besides just Name. I understand I can create an object that inherits the System.Security.Principal.GenericPrincipal class, but how do I store that in the Current.User object in a usable fashion. ie, I can do something like Curr...

My.User.IsAuthenticated bug in WPF

I don't know exactly how to explain it, but here is basically how my problem could be reproduced: Create a WPF Windows Application Project in VB.NET (don't create, just keep reading this, unless you don't believe me...) Click the Window's header to create a Window.Loaded event-handler and to navigate to it. Add the following to the eve...

How can I assign a value to HttpContext.User in ASP.NET MVC ?

I write a controller like below: public class AccountController : Controller { public ActionResult Login(/*---*/) { GenericIdentity identity = new GenericIdentity("userName"); GenericPrincipal principal = new GenericPrincipal(identity, new string[] { "role1", "role2" }); this.HttpContext.User = principal;...

HttpContext User value changing on its own?

Hi everyone, I'm working on an ASP.Net 2.0 application and am having a strange issue involving the HttpContext User. It appears to be changing on its own when I go to a particular page/directory. All of our pages inherit from a base page. In that base page's Page_Load() method we run an authorization check to see if the user can see ...

difference between http.context.user and thread.currentprincipal and when to use them?

I have just recently run into an issue running an asp.net web app under visual studio 2008. I get the error 'type is not resolved for member...customUserPrincipal'. Tracking down various discussion groups it seems that there is an issue with Visual Studio's web server when you assign a custom principal against the Thread.CurrentPrincip...