Skip to content

[Feature] Add functionality to use AAD B2C authentication #186

Open

Description

@tnsturm

AAD-B2C-specifics

Please add some overloads to MSALProvider constructor and GetTokenAsync:

AAD B2C needs the bold marked specifics:

application = PublicClientApplicationBuilder.Create(ClientID)
.WithB2CAuthority(Authority)
.Build();

and

await application.GetAccountsAsync( B2CPolicySignUpSignIn );

Activity

  1. deleted a comment from on Jun 14, 2022
  2. deleted a comment from on Jun 14, 2022
  3. deleted a comment from on Jun 14, 2022
  4. deleted a comment from on Jun 14, 2022
  5. deleted a comment from on Jun 14, 2022
  6. deleted a comment from on Jun 14, 2022
  7. deleted a comment from on Jun 14, 2022
  8. michael-hawker commented on Jun 14, 2022

    @michael-hawker
    Member

    @tnsturm I believe you're talking about this API here?

    I believe this requires us to update our dependency to enable, though I know there's a change in how MSAL is packaged, so I'm not familiar with which side of that gap we're on.

    Not sure if @shweaver-MSFT remembers.

  9. shweaver-MSFT commented on Jun 14, 2022

    @shweaver-MSFT
    Member

    I suggest either:

    1. Create the PublicClientApplication object externally and pass it into the constructor.

      public MsalProvider(IPublicClientApplication client, string[] scopes = null, bool autoSignIn = true)

    2. Extend MsalProvider and override the CreatePublicClientApplication function to add this functionality. Something like a "B2CMsalProvider". You can reference the original method to see how we do it and add in the line you need:

      protected IPublicClientApplication CreatePublicClientApplication(string clientId, string tenantId, string redirectUri, bool listWindowsWorkAndSchoolAccounts)

    If you still think this would make a good addition to the toolkit and have the energy, I'd love someone to take a second look at the problem, think about the issue, propose a fix and put up a PR. Let us know if that sounds interesting to you and feel free to continue the conversation here in this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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