K2 Impersonation with Claim Based authenticated site

  • 30 January 2013
  • 0 replies
  • 0 views

Badge +4

Hi,


following code is working fine with windows authenticated site but not with claim based authenticate site. App pool acc is having impersonation permission. While debugging the code I found K2 connection opened is running with app pool account in case of windows authenticated site and with loggedin user account in case of claim based authenticated site.


How to open the k2 connection with app pool acount in case of claim based authenticated site?? 



SPSecurity



 



 



.RunWithElevatedPrivileges(delegate()


{



 


 


 


 



 



 



 


using (SourceCode.Workflow.Client.Connection connection = new SourceCode.Workflow.Client.Connection

())

{



 



 



 


string _connectionString = new SGXSecurity().GetConnectionString("K2ServerConnectionString");

 



 



 


string _k2ServerName = Convert.ToString(ConfigurationManager.AppSettings["K2ServerName"], CultureInfo.CurrentCulture);

 



 



 



 


connection.Open(_k2ServerName, _connectionString);




connection.ImpersonateUser(



 



"anotheruser");



0 replies

Be the first to reply!

Reply