Skip to main content
to start the workflow using k2ROM, we need to specify the ad domain, username & password as in this example:

mycon.Open ("{servername}", "{domain},{user},{password}")


How can we achieve this dynamically without hardcoding the username password?


If you want to dynamically pickup the credentials, then simply connect using

myCon.Open ("{servername}")


This function is overloaded, and by simply specifying only the server name, it will automatically pickup the user's context (as long as anonymous access is turned off for the site), and the process can be planned without hardcoding the username.
In addition you need to enable impersonation for the webapp, otherwise it attempts to connect to k2 as the ASPNET account. Put this in the web.config file.
<identity impersonate="true" />

Reply