Issue in retrieving data from smart object with UserID and Password added to connection string

  • 29 December 2010
  • 4 replies
  • 4 views

Badge +1

Hi,


I am having admin account with K2. I am able to retrieve the data from the smart object "process_data_audit" with the below code
            SmartObjectClientServer serverName = new SmartObjectClientServer();
            SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionString = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();


            connectionString.Authenticate = true;
            connectionString.Host = "abcdef123d";
            connectionString.Integrated = true;
            connectionString.IsPrimaryLogin = true;
            connectionString.Port = 5454;
            connectionString.SecurityLabelName = "K2";
           
            string smartObjectName = "Process_Data_Audit";
            serverName.CreateConnection();
            serverName.Connection.Open(connectionString.ToString());
            SmartObject smartObject = serverName.GetSmartObject(smartObjectName);
            smartObject.MethodToExecute = "List";
            smartObject.Properties["ProcInstID"].Value = "42";
            SmartObjectList oSmOList = serverName.ExecuteList(smartObject);


But, I am unable to retrieve the data if I pass my credentials along with the connection string. The code added for the credentials
            connectionString.UserID = "abcd";
            connectionString.WindowsDomain = "Domain";
            connectionString.Password = "asdffdsa@1";
Please help me in resolving the issue in getting of data with User information in the connection string.


4 replies

Userlevel 4
Badge +14

Try:


connectionString.UserID = "DOMAINabcd"


Can you see the user being passed through in the K2 Logs when using the connection string? If so please provide the format it is passed details.


K2:Username or K2:DomainUsername


Also run the connection not passing in credentials and see the difference between the formats the credentials is being passed


HTH


Vernon

Badge +1

Hi Vernon,


I tried with connectionString.UserID = "DOMAINabcd", still not retrieving the data from the smart object.


Also, i tried with K2:Username and K2:DomainUsername. I am getting the following error "Authentication With Server Failed : User's Domain is not in list of valid Domains."


Badri.

Badge

Any answer to this? I'm facing the same issue.

Badge

I had a similar issue - upgraded the install from 4.6.8 to 4.6.11. The solution was to update the DLLs I was using in my client app - I still had the 4.6.8 dlls there..

Reply