Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-IFD URLs not handled correctly for on-Prem #397

Open
janis-veinbergs opened this issue Aug 30, 2023 · 1 comment
Open

non-IFD URLs not handled correctly for on-Prem #397

janis-veinbergs opened this issue Aug 30, 2023 · 1 comment
Labels
On Premises Issue applies to On Premises version of Dataverse.

Comments

@janis-veinbergs
Copy link

janis-veinbergs commented Aug 30, 2023

Given I provide non-IFD URL to ServiceClient constructor:

ServiceClient serviceClient = new(new Uri("https://crm.example.com/org"), app.CustomTokenProvider, logger: Logger);
WhoAmIResponse resp = (WhoAmIResponse)serviceClient.Execute(new WhoAmIRequest());
  1. DVSC successfully acquires access_token from /adfs/oauth2/token
  2. DVSC issues request to https://crm.example.com/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.2.49.4384

The request contains proper Authorization bearer token, however the request failed to append /org after host part, thus failing the request.

I'v seen code account for IFD style and non-IFD style URLs:

isOnPrem = true;
//Setting organization for the AD/Onpremise Oauth/IFD
if (serviceUri.Segments.Count() >= 2)
{
organizationName = serviceUri.Segments[1].TrimEnd('/'); // Fix for bug 294040 http://vstfmbs:8080/tfs/web/wi.aspx?pcguid=12e6d33f-1461-4da4-b3d9-5517a4567489&id=294040
}else
{
// IFD style.
var segementsList = serviceUri.DnsSafeHost.Split('.');
if ( segementsList.Length > 1)
{
organizationName = segementsList[0];
}
}
}

So I thought it should work with non-IFD urls.

@MattB-msft MattB-msft added the On Premises Issue applies to On Premises version of Dataverse. label Dec 28, 2023
@KaineVarley
Copy link

Any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Premises Issue applies to On Premises version of Dataverse.
Projects
None yet
Development

No branches or pull requests

3 participants