web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Failed to connect to D...
Power Apps
Answered

Failed to connect to Dataverse - Only loopback redirect uri is supported, but urn:ietf:wg:oauth:2.0:oob was found

(0) ShareShare
ReportReport
Posted on by 9

I've recently implemented D365 in our C# .NET Core App and it works fine on my Windows machine, and when deployed to Azure. However, one of my colleagues on Mac is running into an issue. When the ServiceClient is created, he gets the error: 

Only loopback redirect uri is supported, but urn:ietf: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 below for the stack trace.

 

We construct the ServiceClient like this:

 

var connectionString = $"AuthType=ClientSecret;SkipDiscovery=true;RequireNewInstance=true;Url={settings.OrgUrl};ClientId={settings.AppClientId};ClientSecret={settings.AppClientSecret}";
this._serviceClient = new ServiceClient(connectionString);

Why is it not working? Is it because he's on Mac, or is it something else?

 

Microsoft.PowerPlatform.Dataverse.Client ---> Microsoft.PowerPlatform.Dataverse.Client.Utils.DataverseConnectionException: Failed to connect to Dataverse
       ---> System.AggregateException: One or more errors occurred. (Only loopback redirect uri is supported, but urn:ietf: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)
       ---> MSAL.NetCore.4.39.0.0.MsalClientException: 
        ErrorCode: loopback_redirect_uri
      Microsoft.Identity.Client.MsalClientException: Only loopback redirect uri is supported, but urn:ietf: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
         at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.InitServiceAsync()
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
         at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
         at System.Threading.Tasks.Task`1.get_Result()
         at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.GetCachedService(ConnectionService& ConnectionObject)
         at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.IntilizeService(ConnectionService& ConnectionObject)
         at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.DoLogin(ConnectionService& ConnectionObject)
         at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.CreateServiceConnection(Object externalOrgServiceProxy, AuthenticationType requestedAuthType, String hostName, String port, String orgName, NetworkCredential credential, String userId, SecureString password, String domain, String Geo, String claimsHomeRealm, Boolean useSsl, Boolean useUniqueInstance, OrganizationDetail orgDetail, String clientId, Uri redirectUri, PromptBehavior promptBehavior, OrganizationWebProxyClientAsync externalOrgWebProxyClient, String certificateThumbPrint, StoreName certificateStoreName, X509Certificate2 certificate, Uri instanceUrl, Boolean isCloned, Boolean useDefaultCreds, Version incomingOrgVersion, ILogger externalLogger, String tokenCacheStorePath)
         --- End of inner exception stack trace ---
         at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.CreateServiceConnection(Object externalOrgServiceProxy, AuthenticationType requestedAuthType, String hostName, String port, String orgName, NetworkCredential credential, String userId, SecureString password, String domain, String Geo, String claimsHomeRealm, Boolean useSsl, Boolean useUniqueInstance, OrganizationDetail orgDetail, String clientId, Uri redirectUri, PromptBehavior promptBehavior, OrganizationWebProxyClientAsync externalOrgWebProxyClient, String certificateThumbPrint, StoreName certificateStoreName, X509Certificate2 certificate, Uri instanceUrl, Boolean isCloned, Boolean useDefaultCreds, Version incomingOrgVersion, ILogger externalLogger, String tokenCacheStorePath)
         at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.ConnectToService(String connectionString, ILogger logger)
         at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient..ctor(String dataverseConnectionString, ILogger logger)

 

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @rolandrf,

    It's not because it's a Mac. Are you using Managed Identity (recommended) and did you add the application user in Dataverse?
    Also, try removing the followign properties from the connection string: 

    SkipDiscovery=true;RequireNewInstance=true

     Hope this helps!

  • Verified answer
    rolandrf Profile Picture
    9 on at

    Hi @EricRegnier thanks for your reply. Turns out that the ClientSecret was null for this particular developer.

    Very cryptic error though!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
11manish Profile Picture

11manish 628

#3
Valantis Profile Picture

Valantis 604

Last 30 days Overall leaderboard