azureazure-digital-twins

Azure Digital Twin Authentication - InteractiveBrowserCredential Authentication Failed


Trying to run the sample from Azure-Samples/digital-twins-samples. It is failing here in this code client.GetDigitalTwin("---");

I have entered the required credentials in the authentication window and it gives an exception saying "InteractiveBrowserCredential Authentication Failed".

Inner Exception - "Only loopback redirect uri is supported, but urn:iet:wg:oauth:2.0:oob was found." Configure http://localhost or http://localhost:port both during app registration and when you create the PublicClientApplication object. See https://aka.ms/msal-net-os-browser for details

I have verified whether the role "Azure Digital Twins Owner (Preview)" is present for my user id and I am able to view/update the models & twins in the digital explorer sample from this example ADT explorer, but unable to update model through code. I believe there is some configuration missing in the reply url of the desktop/web url.

Any idea how to fix this issue.


Solution

  • After discussing directly on this issue, we observed that the Internet Explorer on Client Machine is causing/experiencing some blocking on pop-ups.

    Resolution 1:

    Resolution 2:

    Resolution 3:

    Please make sure the AAD Application Authentication has a 'Mobile & Desktop Application' Platform added, along with the redirect URL. For more information please visit this Github issue: