< class="prominent-subhead ">

"OAuth token requires authorization" error

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.


Error when searching for Azure Active Directory users:
"Exception has been thrown by the target of an invocation. OAuth token requires authorization. "


Executing the UMUser Get Users method where Label='AAD' returns the error.

Troubleshooting Steps

The steps below were based on an environment using Azure Active Directory but is not integrated with SharePoint Online.

  1. Open the K2 Management Site.
  2. Expand the Integration node.
  3. Go to Service Instances.
  4. Select the Azure Active Directory service instance.
  5. You may choose to either click on Edit or Refresh Service Instance.
  6. If you chose Edit, click on OK to update the instance.
  7. You should see an OAuth Error with message Redirecting for Authorization. Retry after successful authorization.
  8. If you are prompted to login, provide the credentials of the AAD Tenant Admin.
  9. This should redirect to a page showing Authorization Successful.

If SharePoint Online is in use, try running the Registration Wizard.