Hello.
Kentico
CMS allows you to write a custom authentication provider. In this way, the provided user name and password are checked against an external user profile source/authentication source and if the user is successfully authenticated, the user account is automatically created/updated in the Kentico CMS database, without copying the user password.
You can learn more about custom authentication in chapter
Security handler (CustomSecurityHandler class)..
This is related to integrating authentication with external systems, which is what you want to achieve. Could you please clarify what exact problem do you have, compared to example provided in our documentation?
Basically, our system needs existing record for given user (in our system). To authenticate given user, you can use following example code:
/// <summary>
/// Authenticate given user.
/// </summary>
/// <param name="userName">User name</param>
/// <param name="createPresistentCookie">Indicates if persistent cookie should be created</param>
public static void AuthenticateUser(string userName, bool createPresistentCookie)
{
UserInfo ui = UserInfoProvider.GetUserInfo(userName);
if (ui != null)
{
// Set authentication cookie
FormsAuthentication.SetAuthCookie(ui.UserName, createPresistentCookie);
// Set context values
SetCurrentUser(new CurrentUserInfo(ui, true));
UserInfoProvider.SetPreferredCultures(ui);
// Log authentication event
EventLogProvider ev = new EventLogProvider();
ev.LogEvent(EventLogProvider.EVENT_TYPE_INFORMATION, DateTime.Now, "Authentication", "AUTHENTICATED", ui.UserID, ui.UserName, 0, null, HTTPHelper.GetUserHostAddress(), null, CurrentSiteID, HTTPHelper.GetAbsoluteUri());
}
}
Best Regards,
Radek Macalik