Rainer
Rainer

Reputation: 696

Does ADAL for JavaScript support AAD B2C Preview?

In one of our projects, we have been using Azure Active Directory (AAD) B2C for some time. It works fine. Does anybody know the status of ADAL for JavaScript with AAD B2C? Does it make sense to give it a try? Does anybody have successfully integrated both technologies?

Upvotes: 2

Views: 1431

Answers (2)

Sivalingaamorthy
Sivalingaamorthy

Reputation: 1101

@ this point of time, as per the link provided by MS, looks this feature is not yet supported.

https://azure.microsoft.com/en-in/documentation/articles/active-directory-b2c-limitations/

Single Page Applications (JavaScript)

Many modern applications have a Single Page Application (SPA) front-end that is written primarily in JavaScript and often uses an SPA framework such as AngularJS, Ember.js, Durandal, etc. This flow is not yet available in Azure AD B2C preview.

Upvotes: 1

Rainer
Rainer

Reputation: 696

Today, I tried to use current ADAL for JavaScript with current preview of AAD B2C. Unfortunately it does not work out of the box. As you can see in adal.js, line 850, the URL does not fit to the authorization endpoint that AAD B2C is expecting (has to be .../oauth2/v2.0/authorize..., note the v2.0 here). You can find out the URL or the authorization endpoint using the OpenID Connect metadata at https://login.microsoftonline.com/your_tenant.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=your_signin_policy

If you add v2.0 to the URL by changing ADAL's code and add some additional parameters to extraQueryParameter (see ADAL JS GitHub sample; I needed to specify my sign-in policy p=my_sign_in_policy and the scopes scope=openid%20profile), it seems to work. However, I have not thoroughly tested this change!

To make a long story short: As far as I have seen, ADAL for JavaScript does currently not work with AAD B2C out of the box but it seems as if you could make it work with some changes.

Upvotes: 3

Related Questions