When enabling the K2 OData or K2 REST API you may have an issue when granting consent where it is constantly prompting for credentials. This is usually related to Azure login issues including Multi Factor Authentication (MFA) being enabled. We can check Sign-Ins in the Azure Management console to see if MFA or other login issues occurred.
The following Microsoft KB shows how to look at the Sign-In logs. They offer details on who signed in, if it was successful and what caused it to be successful or unsuccessful.