This is not officially supported by Microsoft, but with some changes to the experimental branch on github azure-activedirectory-library-for-js you can make it work.
Fix logout url to vauto endpoint of the oauth2 protocol with the policy setting in the logOut method for adal.js on line 546:
var urlNavigate = this.instance + tenant + '/oauth2/v2.0/logout?' + logout + (this.config.extraQueryParameter ? '&' + this.config.extraQueryParameter : '');
The username property is never set in the _createUser adal.js. method The username is used in the process of updating the token, correct it by adding three lines:
if (parsedJson.hasOwnProperty('emails')) { user.userName = parsedJson.emails[0]; }
Finally, in adal-angular.js on line 146, purchaseTokenSilent is called with the wrong type parameter. This method accepts only the type of the array as the scopes parameter, corrects it by placing clientId in the array:
_adal.acquireTokenSilent([_adal.config.clientId], null, function (error, tokenOut) {
I already pulled out a github request about this, you can use it as a link.
When you initialize the adal provider in angular, put your b2c login policy in extraQueryParameter as follows:
adalProvider.init({ tenant: 'tenant.onmicrosoft.com', clientId: 'clientid', extraQueryParameter: "p=B2C_1_SignIn" }, $httpProvider);
source share