Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tnsturm opened this issue Feb 17, 2022 · 3 comments
Open

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

tnsturm opened this issue Feb 17, 2022 · 3 comments

Comments

@tnsturm
Copy link

tnsturm commented Feb 17, 2022

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 );

@ghost ghost added the needs triage 🔍 label Feb 17, 2022
@ghost
Copy link

ghost commented Feb 17, 2022

Hello tnsturm, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@michael-hawker
Copy link
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.

@shweaver-MSFT
Copy link
Member

shweaver-MSFT commented Jun 14, 2022

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
Projects
None yet
Development

No branches or pull requests

3 participants