PublicClientApplicationBuilder.WithBroker(Boolean) Method

Definition

Brokers enable Single-Sign-On, device identification, and application identification verification. To enable one of these features, you need to set the WithBroker() parameters to true. See https://aka.ms/msal-net-wam for more information on platform specific settings required to enable the broker.

On iOS and Android, Authenticator and Company Portal serve as brokers. On Windows, WAM (Windows Account Manager) serves as broker. See https://aka.ms/msal-net-wam

public Microsoft.Identity.Client.PublicClientApplicationBuilder WithBroker (bool enableBroker = true);
member this.WithBroker : bool -> Microsoft.Identity.Client.PublicClientApplicationBuilder
Public Function WithBroker (Optional enableBroker As Boolean = true) As PublicClientApplicationBuilder

Parameters

enableBroker
Boolean

Determines whether or not to use broker with the default set to true.

Returns

A PublicClientApplicationBuilder from which to set more parameters, and to create a public client application instance

Remarks

If your app uses .NET classic or .NET, and you wish to use the Windows broker, please install the NuGet package Microsoft.Identity.Client.Broker and call .WithBroker(BrokerOptions). This is not needed if for MAUI apps or for apps targeting net6-windows or higher.

Applies to