You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, testing delegated authentication with a GCCH/DOD account is failing with a null ref exception when creating the service obj. Debug shows the failure in the oAuthHelper class - seems as tho MSAL doesn't like the PCA object created with the default/global authority and trying to use that for non-global auth flows. I worked up a quick switch statement to take the authority string and map that to the enum used in the PCA options object so that we create the PCA object with the correct authority from the beginning.
oAuthHelper.cs (inject @ LINE 92):
//Initialize the cloudInstance enum.
var OAuth2AzCloudInstance = AzureCloudInstance.None;
//Switch to set logon authority enum.
switch (OAuth2Authority)
{
case "https://login.microsoftonline.us":
OAuth2AzCloudInstance = AzureCloudInstance.AzureUsGovernment;
break;
case "https://login.microsoftonline.de":
OAuth2AzCloudInstance = AzureCloudInstance.AzureGermany;
break;
case "https://login.partner.microsoftonline.cn":
OAuth2AzCloudInstance = AzureCloudInstance.AzureChina;
break;
default:
OAuth2AzCloudInstance = AzureCloudInstance.AzurePublic;
break;
}
if (OAuth2RedirectUrl != "<Do not use a redirect URL.>")
{
// Configure the MSAL client to get tokens
pcaOptions = new PublicClientApplicationOptions
{
ClientId = ClientId,
TenantId = TenantId,
RedirectUri = OAuth2RedirectUrl,
AzureCloudInstance = OAuth2AzCloudInstance
};
The text was updated successfully, but these errors were encountered:
Hi, testing delegated authentication with a GCCH/DOD account is failing with a null ref exception when creating the service obj. Debug shows the failure in the oAuthHelper class - seems as tho MSAL doesn't like the PCA object created with the default/global authority and trying to use that for non-global auth flows. I worked up a quick switch statement to take the authority string and map that to the enum used in the PCA options object so that we create the PCA object with the correct authority from the beginning.
oAuthHelper.cs (inject @ LINE 92):
The text was updated successfully, but these errors were encountered: