Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Single Session Sign On View modes: 
User avatar
Member
Member
saikhuan - 7/6/2011 3:35:59 AM
   
Single Session Sign On
Hi,

Does Kentico support single session sign on? I'm building an enterprise application where it's important that two users cannot log in at the same time with the same login credential. When the 2nd user tries to log in with the same username while 1st user is already logged in, the application should not allow the user to log in. Does Kentico have this security feature?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/7/2011 5:44:46 AM
   
RE:Single Session Sign On
Hello,

Regrettably, this feature is not available in Kentico CMS at the moment. You would need to customize the login process to make it work like that. I mean, you would use the Online users module to check whether particular user is already authenticated and write some error message to another one as per your needs.

You might find useful our API reference: http://devnet.kentico.com/downloads/kenticocms_api.zip.

Anyway, I'm sending this forum post as a requirement to our product manager who'll consider adding this feature within one of the next versions. You can also raise a vote on our User Voice portal.

Best regards
Ondrej Vasil

User avatar
Member
Member
saikhuan - 7/7/2011 6:20:45 AM
   
RE:Single Session Sign On
Thanks for the reference! I've added an OnAuthenticate event to the login control in LogonForm Webpart. Hope this will help the others who are looking for similar feature too.


protected void OnAuthenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
string userName = Login1.UserName.Trim();

if (UserInfoProvider.AuthenticateUser(userName, Login1.Password.Trim(), CMSContext.CurrentSite.SiteName) != null)
{
UserInfo ui = UserInfoProvider.GetUserInfo(userName);
CurrentSiteInfo si = CMSContext.CurrentSite;

if (ui != null && si != null)
{
// Check if user is online
if (SessionManager.IsUserOnline(si.SiteName, ui.UserID, true))
{
Authenticated = false;
Login1.FailureText = "Session is already in used.";
}
else
{
Authenticated = true;
}


}
}
e.Authenticated = Authenticated;
}