Fallback to old app if using ppe authority

This commit is contained in:
John Schmeichel 2023-05-03 16:32:08 -07:00
Родитель 9abad78d08
Коммит 71322d7199
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -15,7 +15,9 @@ namespace NuGetCredentialProvider.CredentialProviders.Vsts
public IMsalTokenProvider Get(Uri authority, bool brokerEnabled, ILogger logger)
{
return new MsalTokenProvider(authority, Resource, brokerEnabled ? ClientId : LegacyClientId, brokerEnabled, logger);
// Azure Artifacts is not yet present in PPE, so revert to the old app in that case
bool ppe = authority.Host.Equals("login.windows-ppe.net", StringComparison.OrdinalIgnoreCase);
return new MsalTokenProvider(authority, Resource, brokerEnabled && !ppe ? ClientId : LegacyClientId, brokerEnabled, logger);
}
}
}