Issue

On a new K2 Cloud instance when granting the required consent within Office 365, the following error may be displayed:

"K2TSTS20002: An error occurred while processing an authorization response (invalid_redirect_uri)"

Symptoms

On a brand new K2 Cloud instance, when the provisioning is completed, a customer will receive an email with a link to grant the required consent for K2 within Office 365.

After clicking on the link, a user needs to authenticate with a Global Admin account and click on "Accept" to complete the request.

The following error may be displayed:

"K2TSTS20002: An error occurred while processing an authorization response (invalid_redirect_uri)"

Troubleshooting Steps

During the original onboarding request for a K2 Cloud instance, an Azure Active Directory account is specified (e.g. Cloudadmin@company.com). The K2 Cloud instance is then provisioned against the specified domain name (e.g. Company.com). 

In a scenario where a Client has multiple Azure Active Directories (e.g. Company.com and Company.net), an account from the same Domain as originally specified needs to be used when the "K2 for Office 365" consent is given. If the consent is given using an account from a different Domain, the error will be encountered.