Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>

<!--
** The WebView2 package references its WPF control in every .NET project, including those that get the package
** transitively. Bravo hosts the WinForms control only, and the WPF assembly built for net5.0 references WindowsBase 5.0,
** which conflicts with the framework's WindowsBase (MSB3277).
** See https://github.com/MicrosoftEdge/WebView2Feedback/issues/4959
** The condition limits the target to SDK-style projects: the legacy WiX projects under installer/wix import this file too.
-->
<Target Name="RemoveWebView2WpfReference" BeforeTargets="ResolveAssemblyReferences" Condition="'$(UsingMicrosoftNETSdk)' == 'true'">
<ItemGroup>
<Reference Remove="@(Reference)" Condition="'%(Filename)' == 'Microsoft.Web.WebView2.Wpf'" />
</ItemGroup>
</Target>

</Project>
3 changes: 1 addition & 2 deletions installer/wix/src/Bravo/Bravo.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- Tag files with the "*ToRemove" key -->
<xsl:key name="IdentityClientToRemove" match="wix:Component[wix:File/@Source='$(var.PublishFolder)\Microsoft.Identity.Client.dll']" use="@Id" />
<xsl:key name="NewtonsoftJsonToRemove" match="wix:Component[wix:File/@Source='$(var.PublishFolder)\Newtonsoft.Json.dll']" use="@Id" />
<xsl:key name="WebView2ToRemove" match="wix:Component[contains(wix:File/@Source, '\WebView2Loader.dll') or wix:File/@Source='$(var.PublishFolder)\Microsoft.Web.WebView2.Core.dll' or wix:File/@Source='$(var.PublishFolder)\Microsoft.Web.WebView2.WinForms.dll' or wix:File/@Source='$(var.PublishFolder)\Microsoft.Web.WebView2.Wpf.dll']" use="@Id" />
<xsl:key name="WebView2ToRemove" match="wix:Component[contains(wix:File/@Source, '\WebView2Loader.dll') or wix:File/@Source='$(var.PublishFolder)\Microsoft.Web.WebView2.Core.dll' or wix:File/@Source='$(var.PublishFolder)\Microsoft.Web.WebView2.WinForms.dll']" use="@Id" />
<!-- Don't render anything tagged with "*ToRemove" key -->
<xsl:template match="*[self::wix:Component or self::wix:ComponentRef][key('IdentityClientToRemove', @Id)]" />
<xsl:template match="*[self::wix:Component or self::wix:ComponentRef][key('NewtonsoftJsonToRemove', @Id)]" />
Expand Down Expand Up @@ -60,7 +60,6 @@
<File Id="fileWebView2Loader" KeyPath="no" Source="$(var.PublishFolder)\WebView2Loader.dll" />
<File Id="fileWebView2Core" KeyPath="no" Source="$(var.PublishFolder)\Microsoft.Web.WebView2.Core.dll" />
<File Id="fileWebView2WinForms" KeyPath="no" Source="$(var.PublishFolder)\Microsoft.Web.WebView2.WinForms.dll" />
<File Id="fileWebView2Wpf" KeyPath="no" Source="$(var.PublishFolder)\Microsoft.Web.WebView2.Wpf.dll" />
</Component>
<ComponentRef Id="cmpWebView2LoaderNative" />
</xsl:copy>
Expand Down
4 changes: 2 additions & 2 deletions src/Bravo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<PackageReference Include="LargeXlsx" Version="2.0.1" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.23.0" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2739.15" />
<PackageReference Include="Microsoft.Identity.Client.Desktop" Version="4.73.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
<PackageReference Include="Microsoft.Identity.Client.Desktop" Version="4.83.3" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.363" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.10.85" PrivateAssets="all" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" PrivateAssets="all" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -25,7 +27,11 @@ public interface ICloudAuthenticationClient
internal sealed class CloudAuthenticationClient(IPolicyService policyService) : ICloudAuthenticationClient
{
private const string SystemBrowserRedirectUri = "http://localhost";
private const string OrganizationalAccountsOnlyQueryParameter = "msafed=0"; // no Microsoft accounts (MSA) allowed

// msafed=0 allows organizational accounts only (no Microsoft accounts). It filters the accounts offered at
// sign-in and does not change the token, so it stays out of the cache key.
private static readonly ReadOnlyDictionary<string, (string Value, bool IncludeInCacheKey)> ExtraQueryParameters = new(
new Dictionary<string, (string Value, bool IncludeInCacheKey)> { ["msafed"] = ("0", false) });

private readonly IPolicyService _policyService = policyService;

Expand Down Expand Up @@ -65,7 +71,7 @@ public async Task ClearTokenCacheAsync(CloudEnvironment environment)
private static async Task<Msal.AuthenticationResult> AcquireTokenSilentAsync(
IPublicClientApplication client, string[] scopes, string email, CancellationToken cancellationToken)
{
var extraQueryParameters = OrganizationalAccountsOnlyQueryParameter;
var extraQueryParameters = ExtraQueryParameters;
var loginHint = email;

var builder = client.AcquireTokenSilent(scopes, loginHint)
Expand All @@ -79,7 +85,7 @@ public async Task ClearTokenCacheAsync(CloudEnvironment environment)
{
var useSystemBrowser = _policyService.Current.UseSystemBrowserForAuthentication ?? UserPreferences.Current.UseSystemBrowserForAuthentication;
var useEmbeddedBrowser = !useSystemBrowser;
var extraQueryParameters = OrganizationalAccountsOnlyQueryParameter;
var extraQueryParameters = ExtraQueryParameters;
var prompt = Prompt.SelectAccount;
var loginHint = email;

Expand Down
50 changes: 25 additions & 25 deletions src/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@
},
"Microsoft.Identity.Client.Desktop": {
"type": "Direct",
"requested": "[4.73.1, )",
"resolved": "4.73.1",
"contentHash": "9icFisK5u6eb+MYwPFTyilue+5gU/kiyTLj8M5tpUokGAmxK7ByYh9v6z//k0JKg3dZ+l7IQaHKdGFNwCgk18A==",
"requested": "[4.83.3, )",
"resolved": "4.83.3",
"contentHash": "FaGsOLZm6KR0pgj3rkKLUMXni4LSpAiCaUK66PU7XnbU1rgH+1IouWj2vGfRPpSKpV7DDdUSfKEYhZFS+FpBfw==",
"dependencies": {
"Microsoft.Identity.Client": "4.73.1",
"Microsoft.Identity.Client.Broker": "4.73.1",
"Microsoft.Web.WebView2": "1.0.864.35"
"Microsoft.Identity.Client": "4.83.3",
"Microsoft.Identity.Client.Broker": "4.83.3",
"Microsoft.Web.WebView2": "1.0.2903.40"
}
},
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2739.15, )",
"resolved": "1.0.2739.15",
"contentHash": "hZg7vHWBg4RIiK3rhkNqX3hcBqqoVXVrrO2BVrVOiSmEgfLa7lY64G1tWh2VY84MfHIFLCAQNwn3Rwvu+ICHyw=="
"requested": "[1.0.2903.40, )",
"resolved": "1.0.2903.40",
"contentHash": "THrzYAnJgE3+cNH+9Epr44XjoZoRELdVpXlWGPs6K9C9G6TqyDfVCeVAR/Er8ljLitIUX5gaSkPsy9wRhD1sgQ=="
},
"Microsoft.Windows.CsWin32": {
"type": "Direct",
Expand Down Expand Up @@ -202,30 +202,30 @@
},
"Microsoft.Identity.Client": {
"type": "Transitive",
"resolved": "4.73.1",
"contentHash": "NnDLS8QwYqO5ZZecL2oioi1LUqjh5Ewk4bMLzbgiXJbQmZhDLtKwLxL3DpGMlQAJ2G4KgEnvGPKa+OOgffeJbw==",
"resolved": "4.83.3",
"contentHash": "XNJJn5uctuGvl3u6qzAof2TNysAZ/PPVKzkAglxvTO5XHgff/Ibs1+yi2G26Xrf6X/f780kS4fMKKdHcGb96hQ==",
"dependencies": {
"Microsoft.IdentityModel.Abstractions": "6.35.0"
"Microsoft.IdentityModel.Abstractions": "8.14.0"
}
},
"Microsoft.Identity.Client.Broker": {
"type": "Transitive",
"resolved": "4.73.1",
"contentHash": "gCtm9dYAwKohMXcVXFRv8/7IIJQTkCNu6S9mSmxvJ8geNGRhQ3F/PDOMlloCulEgpkIhKwclOLV+aUlIWrEWxA==",
"resolved": "4.83.3",
"contentHash": "1yn682hgnCimnYR27Ne/SRMWxCWUZtCKjYwPzWbjrfhqBF1GS7bDlPZkF4yvJxl90Y+xzDdZFh4u9pcGIFSEvw==",
"dependencies": {
"Microsoft.Identity.Client": "4.73.1",
"Microsoft.Identity.Client.NativeInterop": "0.19.2"
"Microsoft.Identity.Client": "4.83.3",
"Microsoft.Identity.Client.NativeInterop": "0.20.4"
}
},
"Microsoft.Identity.Client.NativeInterop": {
"type": "Transitive",
"resolved": "0.19.2",
"contentHash": "qXNtYJxZ15yKV5pnI+V0sRzIH++vNzmMOU3K8kyNGsMD8/q7+ZejQjm7gJI9MMEGDPQkGg3QaiMvrIgbH2ym2g=="
"resolved": "0.20.4",
"contentHash": "JHlfJ8oolxj20sNlwdIh8H8MZtzVQ55MyOjrIrQCtD/KJL5x8EOjQxafYu8AEYZOCSW+09DQnRogGk+J37BURA=="
},
"Microsoft.IdentityModel.Abstractions": {
"type": "Transitive",
"resolved": "6.35.0",
"contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg=="
"resolved": "8.14.0",
"contentHash": "iwbCpSjD3ehfTwBhtSNEtKPK0ICun6ov7Ibx6ISNA9bfwIyzI2Siwyi9eJFCJBwxowK9xcA1mj+jBWiigeqgcQ=="
},
"Microsoft.OpenApi": {
"type": "Transitive",
Expand Down Expand Up @@ -285,9 +285,9 @@
"net10.0-windows7.0/win-x64": {
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2739.15, )",
"resolved": "1.0.2739.15",
"contentHash": "hZg7vHWBg4RIiK3rhkNqX3hcBqqoVXVrrO2BVrVOiSmEgfLa7lY64G1tWh2VY84MfHIFLCAQNwn3Rwvu+ICHyw=="
"requested": "[1.0.2903.40, )",
"resolved": "1.0.2903.40",
"contentHash": "THrzYAnJgE3+cNH+9Epr44XjoZoRELdVpXlWGPs6K9C9G6TqyDfVCeVAR/Er8ljLitIUX5gaSkPsy9wRhD1sgQ=="
},
"Microsoft.AnalysisServices.AdomdClient": {
"type": "Transitive",
Expand All @@ -300,8 +300,8 @@
},
"Microsoft.Identity.Client.NativeInterop": {
"type": "Transitive",
"resolved": "0.19.2",
"contentHash": "qXNtYJxZ15yKV5pnI+V0sRzIH++vNzmMOU3K8kyNGsMD8/q7+ZejQjm7gJI9MMEGDPQkGg3QaiMvrIgbH2ym2g=="
"resolved": "0.20.4",
"contentHash": "JHlfJ8oolxj20sNlwdIh8H8MZtzVQ55MyOjrIrQCtD/KJL5x8EOjQxafYu8AEYZOCSW+09DQnRogGk+J37BURA=="
},
"System.IO.FileSystem.AccessControl": {
"type": "Transitive",
Expand Down
Loading