Authenticating against SQLUM

  • 18 September 2007
  • 3 replies
  • 2 views

Badge +1

Hi all,


I am trying to open the worklist using the Client API. How do I authenticate against the SQLUM? Do I have to give the name of the user with the prefix "K2SQL" ?


SourceCode.Workflow.Client.

Connection K2Conn = new SourceCode.Workflow.Client.Connection();


K2Conn.Open(

"BLACKPEARL", "K2SQL:k2");


 When I do this, I still have the AD user as the user in the connection object.


Thanks,


Tony


3 replies

Badge +11

Hi Tony,


I suppose there are other ways to do it but the one I've played with before was to Impersonate the K2SQL user:


// get connection to server


k2Con.Open(ConfigurationManager.AppSettings[

"bpserver"].ToString());


k2Con.ImpersonateUser(

"K2SQL:User3");


HTH,


Ockert

Badge +1

Thanks Ockert. That did work.


In the Client API, the connection object accepts a connectionsetup class.


SourceCode.Workflow.Client.ConnectionSetup has a property named "ConnectionString". What could be the format for this connection string?(for both AD and SQLUM authentications). Is it possible to connect to the server by providing a connectionstring to the "ConnectionSetup"  class?


 


Thanks,


Tony

Badge +11

ConnectionSetup connSetup = new ConnectionSetup();


connSetup.ConnectionString = string.Format("Integrated=False;IsPrimaryLogin=True; Authenticate=True;EncryptedPassword=False; Host={0};Port=5252;SecurityLabelName=K2SQL; UserID={1};Password={2};", server,tbUserID.Text, tbPassword.Text);


 


conn.Open(connSetup);

Reply