locked
How to set Current User in moss 2007 for Authentication.... RRS feed

  • Question

  • 1. Current work flow :-In web site the user have to register themselves in the web site and enters his details along with user id, password and email id. Once user is registered then he will login with his user id and password. The user id is picked from login control and that set in “SPWeb.CurrentUser” as user id and system uses "Membership.ValidateUser" method to Authenticate user for login. 
    2. New Requirement: we would like to facilitate the user to login with Email id as well as user id. 
    Problem: 
    We replaced "Membership.ValidateUser" method to our own method to Authenticate user with email id/user id and password. 
    When user is login with user id and password it is working successfully but in the case of email id and password –“the email id is picked from user control and set as "HttpContext.Current.User.Identity.Name" but we are not getting “SPWeb.CurrentUser” and it shows null value.” 
    We are able to get user id from database using email id of user. Please help us how we can set user id in "SPContext.Current.Web.CurrentUser".

    Wednesday, August 13, 2014 5:34 AM

All replies

  • Hi Mohan - Can you provide more description on

    I'm able to retrieve the user id of current user using Email but I am NOT able to set that user id for current user for further authentication using Moss 2007.

     ID is already assigned to logged in user than What further authentication is required?

    -prs

    Wednesday, August 13, 2014 5:50 AM