< class="prominent-subhead ">

When using APIs services with AAD authentication and clicking "Setup AAD Consent," returns HTTP 404 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.
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.


In K2 Five, when trying to use APIs services with AAD authentication and clicking on the "Setup AAD Consent" button, an error HTTP 404 is displayed.


The error appears as:

"HTTP 404 error That’s odd... Microsoft Edge can’t find this page".

A link that looks like the example below is visible on the address bar:

Troubleshooting Steps

When looking at the URL that is opened when the consent button is clicked, you will notice that it is missing a GUID after the "https://login.microsoftonline.com/".

The correct URL should be, for example: "https://login.microsoftonline.com/333333f1-af343-4789-8ab56-333334ef92/oauth2/authorize".

The "setup AAD Consent" button relies on the Authorization Endpoint of the OAuth resource of type "Microsoft Online AppOnly". This can be seen from Management Site > Authentication > OAuth > Resources.

To resolve this issue, please edit the resources to include the tenant ID.