Skip to main content

I can access the Rest API with Basic Authentication using the K2 admin account. Our intention is to replace the dependency on SourceCode.Workflow.Client API with Rest API. In order to do this we must be able to access the Rest API using a custom security provider (as we have a custom security provider for handling users and groups).

 

For SourceCode.Workflow.Client API, a connection is set like this:

 

builder.SecurityLabelName = //the name of our custom security label
builder.UserID = //user name to be authenticated
builder.Password = //password for the user to be authenticated

 

We need some way of doing this using Rest API. Is it possible to select which security label to use for Basic Authentication (with Rest API)? Or does this require Oauth authentication? I've seen examples using Azure active directory but at the moment we don't have that, is there any other way (that does not require Azure)? The call is made from an external application (we are not using Sharepoint).

Hi,


 


Have you tried specifying the security label in the username when setting up the basic authentication parameters? Try the following format:


 


<security label><username>


 


Hi,

 

I got a tip that I should try <security label>:<username>, but so far I have not had any luck with that nor "". Domain user account of K2 admin works, but anything else gives me a 401. I found an interesting setting in the app settings section of API web.config, DefaultSecurityLabelFallback. I set this to the value of our security label, but this did not make any noticable difference. Is there any documentation to be found on these settings anywhere? 


Reply