1/20/2009 9:34:04 PM
I've modified the CustomSecurityHandler OnAuthentication method to get users from our external database using example from Kentico documentation.
After successfully inserting a new user, I cannot log in the user as the OnAuthentication object userInfo returns null. I'm guessing it has something to do with the password but can't see what the problem is.
If anyone can help, I would greatly appreciate it.
Here is the code I've used.
// Create base user record if user found
usr = new UserInfo();
usr.IsExternal = true;
usr.UserName = username;
usr.FullName = "John Bloke";
usr.Email = email@example.com;
usr.Enabled = true;
// Init user sites and roles if requested
Hashtable rolesTable = new Hashtable();
string siteName = CMSContext.CurrentSite.SiteName;
// Assign user to the current site
usr.SitesRoles[siteName.ToLower()] = rolesTable;
// Add new role "external role" and assign it to the user
rolesTable["RegisteredUser"] = 0;
// Create new user
// Set user password