This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
You are unable to use OAuth to access K2 API. You are unable to authenticate using OAuth2 when using K2 API, although everything appears to be configured correctly in K2 Management portal and AAD.
When testing with Postman, you are able to request a token for https://api.k2.com, but when making a call to https://KUID.onk2.com/api/odata/v3/ or https://KUID.onk2.com/api/Workflow/V1/workflows with the token in the header, you just receive a 401 Unauthorized response.
You are also unable to access K2 API using Swagger UI as it always gives a 401 Unauthorized error.
When making a call to https://KUID.onk2.com/api/odata/v3/ or https://KUID.onk2.com/api/Workflow/V1/workflows with the token in the header you receive a 401 Unauthorized response.
This problem can appear when your OAuth URL does not have final forward slash, i.e. it looks as follows:
In this case adding "/" to the very end of this URL can resolve your problem.