Symptoms
Attempted to perform an unauthorized operation.
Diagnoses
After re-configuring the K2Services/WCF.svc to using HTTPS with the 'basicHttpBinding", the following piece of code in a custom web application:
processInstance = processNavigationServiceClient.StartNewProcessInstance(processInstance, false, false, false, false, false)
errors with:
Attempted to perform an unauthorized operation.
Resolution
The necessary configurations was made in the web.config file for the "K2Services" child web application as well the web.config file for the custom web application (that is calling the K2Services/WCF.svc) to resolve the issue. The custom web application uses ASP.Net Impersonation to pass the current user's credentials accessing the custom web application to the K2Services/WCF.svc for the StartNewProcessInstance call. This will show up in the custom web application's web.config as:
<identity impersonate="true"/>
Some relevant configuration values includes:
- "Authentication" mode for the custom web application as well as the "K2Services" child web application
- the application pool for the custom web application as well as the "K2Services" child web application
- the "Providers" available if using Windows Authentication for both web applications
- the options, "Transport/Message/TransportWithMessageCredential" for both web applications
- the options, "Basic/Certificate/Digest/None/Ntlm/Windows" for both web applications
Please see documentation below for more information:
http://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm_configure_ssl.html
https://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm_start_a_workflow_using_wcf_service.html
Additional information:
https://msdn.microsoft.com/en-us/library/ff649309.aspx
https://msdn.microsoft.com/en-us/library/ff649264.aspx