YAFLogo

g-avvx
  • g-avvx
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
I am running YAF 1.9.3 (just in test at the moment) and need to integrate with the existing security (not Microsoft) of my site.

From the documentation - "How to Integrate with Asp.net membership", I wrote the following to login:

string userName = "test";

string plainText = "test12!";

string password = FormsAuthentication.HashPasswordForStoringInConfigFile(plainText, "md5");

Object userID = DB.user_login(1, userName, password);

if (userID != DBNull.Value)

{

string idName = string.Format("{0};{1};{2}", userID, 1, userName);

FormsAuthentication.SetAuthCookie(idName, false);

}

But userID is never returned (Null). If I omit the call to HashPasswordForStoringInConfigFile and send the plain text to user_login, then the correct userID is returned, the cookie is set, but I don't get logged on.

Is this method appropriate to 1.9.3 or should I be using something else?

Sponsor