Skip to content

[Feature] Enable MsalProvider to use the native account broker #168

@shweaver-MSFT

Description

@shweaver-MSFT

Describe the problem this feature would solve

Currently the MsalProvider throws the web based authentication prompt every time. Even though the native broker is available, we don't use it.

Describe the solution

There is an option PublicClientApplicationBuilder.WithBroker() that can be used during the construction of the IPublicClientApplication object in the MsalProvider constructor. This shows the native account picker instead of the web based prompt, which lacks convenience features like already knowing who you are based on the current Windows login.

This feature should be enabled without breaking the MsalProvider. A configuration parameter should be added to the constructor to hold config values with defaults:

class MsalProviderConfiguration
{
    // Use this to turn the native account broker on/off
    public bool UseBroker { get; set; } = true;

    // Use this to indicate the authority and which account types should be supported.
    public bool ListWindowsWorkAndSchoolAccounts { get; set; } = true;
}

Describe alternatives you've considered

Additional context & Screenshots

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions