Library version used
4.64.1
.NET version
8.0.8
Scenario
PublicClient - desktop app
Is this a new or an existing app?
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
I am trying to use the broker now, because i want to get the benefit of it instead of relying on the browser. But somehow the WithBorker call messes with the redirect URI. The redirect URI for this MICROSOFT APPLICATION can not be changed.
Relevant code snippets
// Fails with "AADSTS50011: The redirect URI 'ms-appx-web://Microsoft.AAD.BrokerPlugin/fb78d390-0c51-40cd-8e17-fdbfab77341b' specified in the request does not match the rediret URIs configureg for the application 'fb78d390-0c51-40cd-8e17-fdbfab77341b'.
string[] scopes = ["https://outlook.office365.com/.default"];
BrokerOptions options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows);
options.Title = "Provide credentials";
IPublicClientApplication app =
PublicClientApplicationBuilder.Create("fb78d390-0c51-40cd-8e17-fdbfab77341b")
.WithAuthority(AzureCloudInstance.AzurePublic, tenantId)
.WithRedirectUri("http://localhost")
.WithBroker(options)
.WithParentActivityOrWindow(GetConsoleOrTerminalWindow)
.Build();
string accessToken = (await app.AcquireTokenInteractive(scopes).ExecuteAsync()).AccessToken;
// Succesfully fetches access token.
string[] scopes = ["https://outlook.office365.com/.default"];
IPublicClientApplication app = PublicClientApplicationBuilder.Create("fb78d390-0c51-40cd-8e17-fdbfab77341b")
.WithAuthority(AzureCloudInstance.AzurePublic, tenantId)
.WithRedirectUri("http://localhost")
.Build();
string accessToken = (await app.AcquireTokenInteractive(scopes).ExecuteAsync()).AccessToken;
Expected behavior
I would expect this to just work.
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response
Library version used
4.64.1
.NET version
8.0.8
Scenario
PublicClient - desktop app
Is this a new or an existing app?
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
I am trying to use the broker now, because i want to get the benefit of it instead of relying on the browser. But somehow the
WithBorkercall messes with the redirect URI. The redirect URI for this MICROSOFT APPLICATION can not be changed.Relevant code snippets
Expected behavior
I would expect this to just work.
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response