2

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.

SatishBoddu
  • 752
  • 6
  • 13
Harish
  • 193
  • 1
  • 3
  • 14
  • What is the complete Redirect URL you gave when registering the APP in AAD? Have you enabled the Tokens as well? – SatishBoddu Aug 07 '20 at 05:23
  • I have provided Web url as "http://localhost", please suggest any other url to be added. Access Tokens & ID Tokens are enabled. – Harish Aug 07 '20 at 05:29
  • May I know from which document you have taken that instruction ? have you tried http://localhost:3000 ? I have created a new user like 'Tester@satishOrg.onmicrosoft.com' and used that for the login , also provided the ADT Owner Permissions to this user. – SatishBoddu Aug 07 '20 at 05:38
  • I tried with multiple options. Initially with http://localhost:3000 and then http://localhost. I have created the twin using scripted version as provided in this document "https://learn.microsoft.com/en-us/azure/digital-twins/how-to-set-up-instance-scripted". Both gives same error. – Harish Aug 07 '20 at 05:51
  • Ok, please remove the tokens and keep only 'Mobile & Desktop' AAD App Authentication, and try again. – SatishBoddu Aug 07 '20 at 05:59
  • I removed web authentication and added 'mobile & desktop' with redirect url as "http://localhost:3000" and this has not resolved the issue. Do we need to add any urls related to msal? please confirm and thanks for trying to resolve the issue. – Harish Aug 07 '20 at 06:11
  • have you selected the checkbox which says (MSAL only) when you have added 'Mobile & Desktop App' Platform? – SatishBoddu Aug 07 '20 at 06:16
  • Sorry many questions, i hope you have provided the values for "tenantId": "clientId": 'instanceUrl' inside the ServiceConfig.json file ? and plz remove ur latest comment to avoid sensitive data on the public forums. – SatishBoddu Aug 07 '20 at 06:28
  • yes, I provided the details in serviceConfig.json, updated the properties to "Copy if newer" and verified in the code whether the values are getting assigned. – Harish Aug 07 '20 at 06:37
  • Please send an email to azcommunity@microsoft.com with these details,Thread URL: Link to this thread. Azure Subscription ID: Email Subject : Attn Satish Boddu We will work on this with you! – SatishBoddu Aug 07 '20 at 06:44
  • 1
    I sent email to azcommunity@microsoft.com with the details – Harish Aug 07 '20 at 06:56

1 Answers1

1

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:

  • Please check if there are any pop-up blockers enabled on the browser.
  • Please change the default browser to another browser [like chrome] and re-try.
  • Clear the browser cache and close all opened browser sessions.
  • Restart VS2019 and try to run the sample code.

Resolution 2:

  • Make sure you are using Azure.Identity latest NuGet Package. As of today 09/02/2020 the working version is Azure.Identity 1.2.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:

SatishBoddu
  • 752
  • 6
  • 13