Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Windows Authentication

  1. #1
    Zuluu is offline Junior Member
    Join Date
    Sep 2008
    Posts
    1

    Default Windows Authentication

    ADNSF version: 7.1

    Hi,
    I'm trying to map windows user accounts to ADNSF customers using the email address. I turned off forms authentication and turned on windows authentication. I can retrieve the windows suer, get his email address, find the CustomerID with the same email address in the database - no problem. The trouble is that I'm not able to create a new Customer object and set it as the currently logged on user. Here are the details:

    I do all that in Global.asax (the original code behind is not in source code anymore, so I had to create a child class of it). There is an event handler for the WindowsAuthentication module:

    public void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs e)
    {
    Customer c = GetRelatedCustomer(e);
    e.User = new AspDotNetStorefrontPrincipal(customer);
    }


    This is the default procedure to create custom IPrincipal objects when using windows authentication. The IPrincial applied to e.User will normally show up in HttpContext.Current.User. In this case, it doesn't. I suspect that the compiled code behind of Global.asax replaces the IPrincipal object afterwards. Is that true? How can I assign my own IPrincipal to HttpContext.Current.User? I cannot do that in signin.aspx because then the HttpContext.Current.User has already been replaced and I won't find information about the logged-on windows user.

    Any help is appreciated.

    Best regards,
    Munir Husseini

  2. #2
    dnoya is offline Junior Member
    Join Date
    Jan 2009
    Posts
    3

    Default Same PRoblem

    Hi Im having almost the same problem.

    I need to get the NT user Name of the person in the site.

    WHere is the HttpContext.Current.User gets Assign?

    Thanks,
    Diego