Francessco121 / msal-js-dart

A Dart wrapper for the "Microsoft Authentication Library for JavaScript (MSAL.js)".
https://pub.dev/packages/msal_js
MIT License
14 stars 9 forks source link

AD B2C authority not working #13

Closed ManishKiranagi closed 4 years ago

ManishKiranagi commented 4 years ago

Describe the bug I am using AD B2C tenant. And I am using the authority in the form of https:///tfp/// as mentioned in the configuration.dart for Azure B2C. But it is going to the wrong authorize endpoint starting with https://login.microsoftonline.com and I am getting bad request error.

Environment (please complete the following information):

Francessco121 commented 4 years ago

Looks like markdown messed up the docs for authority, you're using it in the form of https://{instance}/tfp/{tenant}/{policyName}/ correct?

The authority format for B2C also changed somewhat recently to https://{your-tenant-name}.b2clogin.com/tfp/{your-tenant-id}/{policy-name}/ (doesn't use login.microsoftonline.com for the first part). You may also not need the tfp part, the B2C docs are inconsistent with it so I don't really understand why it's needed sometimes and others not.

msal.js also has some issues with the new B2C authorities. If you're not setting validateAuthority to false, make sure to add the domain you use to knownAuthorities ({your-tenant-name}.b2clogin.com).

Francessco121 commented 4 years ago

Closing this for now.

If you're still having configuration troubles, you may want to consider opening an issue up in the msal.js repo https://github.com/AzureAD/microsoft-authentication-library-for-js. This package just passes configuration directly to it.

ManishKiranagi commented 4 years ago

@Francessco121 Thanks for your help. I managed to get it working with setting validateAuthority to false.