API
Version 7.x > API > SSO from External site View modes: 
User avatar
Member
Member
matt.ruwe-hfit - 12/21/2012 8:52:23 AM
   
SSO from External site
I'm trying to itegrate an SSO solution into Kentico and need to figure out how to force a user logon with Kentico. I've been experimenting with the CMSLoaderAttribute and have the following code:

[PlatformSecurityEventsAttribute]
public partial class CMSModuleLoader
{
private class PlatformSecurityEventsAttribute : CMSLoaderAttribute
{
public override void Init()
{
CMSRequestEvents.Authenticate.Before += Authenticate_Before;
}


void Authenticate_Before(object sender, EventArgs e)
{
string username = "administrator";
CMSContext.AuthenticateUser(username, true);
}
}
}

I can see the breakpoints being hit and using Fiddler, I can even see the FormsAuthentication cookie being set in the browser. However, I'm still redirected to the logon page within Kentico. How can I overcome this?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/21/2012 9:13:55 PM
   
RE:SSO from External site
Hello,

You can for example modify the logon page to check if the User is authenticated and redirect him back to the source page which should be passed as a query string. The file to modify is located in:

CMSPages\logon.aspx.cs

Best regards,
Boris Pocatko