I tried to write my own login module for our platform. And I copied the code of DNN AuthenticationService from the DNN source project. But it didn't work.
Any one can give me some advice? following code is what I wrote:
private void LoginUser(string username, string password)
{
var status = UserLoginStatus.LOGIN_FAILURE;
var objUser = UserController.ValidateUser(PortalId, username, password,
"DNN", PortalSettings.PortalName, UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)), ref status);
var authenticated = Null.NullBoolean;
var message = Null.NullString;
if (status == UserLoginStatus.LOGIN_USERNOTAPPROVED)
message = "UserNotAuthorized";
}
else
authenticated = status != UserLoginStatus.LOGIN_FAILURE;
// Raise UserAuthenticated Event
var eventArgs = new UserAuthenticatedEventArgs(objUser, username, status, "DNN")
Authenticated = authenticated,
Message = message,
RememberMe = false,
};
this.OnUserAuthenticated(eventArgs);
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.