From 8ac94781b7a9bd3ad8cc65d73b3815f30a9e4b72 Mon Sep 17 00:00:00 2001 From: Daniel Xiao Date: Sun, 8 Sep 2024 22:48:18 -0500 Subject: [PATCH] remove redirect uri --- .../DeviceCodeAuthenticationFactory.cs | 6 ++++-- .../Common.Authentication/WindowsAuthenticationFactory.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Common/Common.Authentication/DeviceCodeAuthenticationFactory.cs b/src/Common/Common.Authentication/DeviceCodeAuthenticationFactory.cs index cd038cc..26be2d1 100644 --- a/src/Common/Common.Authentication/DeviceCodeAuthenticationFactory.cs +++ b/src/Common/Common.Authentication/DeviceCodeAuthenticationFactory.cs @@ -23,12 +23,14 @@ namespace Microsoft.PowerBI.Common.Authentication IEnumerable scopes = new[] { $"{environment.AzureADResource}/.default" }; if (this.AuthApplication == null) { + BrokerOptions options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows); + options.Title = "My Awesome Application"; + this.AuthApplication = PublicClientApplicationBuilder .Create(environment.AzureADClientId) .WithAuthority(environment.AzureADAuthority) .WithLogging((level, message, containsPii) => LoggingUtils.LogMsal(level, message, containsPii, logger)) - .WithRedirectUri(environment.AzureADRedirectAddress) - .WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows)) + .WithBroker(options) .Build(); } diff --git a/src/Common/Common.Authentication/WindowsAuthenticationFactory.cs b/src/Common/Common.Authentication/WindowsAuthenticationFactory.cs index b99e946..dc85670 100644 --- a/src/Common/Common.Authentication/WindowsAuthenticationFactory.cs +++ b/src/Common/Common.Authentication/WindowsAuthenticationFactory.cs @@ -114,13 +114,15 @@ namespace Microsoft.PowerBI.Common.Authentication // auth application is auto cleared when there's no account if (this.AuthApplication == null) { + BrokerOptions options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows); + options.Title = "My Awesome Application"; + var authApplicationBuilder = PublicClientApplicationBuilder .Create(environment.AzureADClientId) .WithAuthority(environment.AzureADAuthority) .WithLogging((level, message, containsPii) => LoggingUtils.LogMsal(level, message, containsPii, logger)) .WithExtraQueryParameters(queryParameters) - .WithRedirectUri(environment.AzureADRedirectAddress) - .WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows)); + .WithBroker(options); if (!PublicClientHelper.IsNetFramework) {