Microsoft-authentication-library-for-js: AngularJS 1 / 2 / 4 support

Created on 6 Jun 2017  路  12Comments  路  Source: AzureAD/microsoft-authentication-library-for-js

Like old Azure Active Directory Authentication Library (ADAL) for JavaScript had a library AngularJS 1 (adal-angular.js), and we hope Angular 2 and Angular 4.

Are there any plans to develop Angular library inside MSAL for major stable version (1,2,4) ?

enhancement

Most helpful comment

@hkusulja There are plans in MSAL roadmap this year for an Angular library.

All 12 comments

With the newly released HttpClient in Angular it allows for interceptors. Building an interceptor like what was done for the ADAL library should be feasible now.

I created a fully working example using MSAL in an Angular 4 / .Net Core application, based off the Angular 4 .Net starter template. https://github.com/Gimly/NetCoreAngularAzureB2CMsal

I also have a simpler example with just Angular 4 https://github.com/Gimly/simpleAngularAzureB2C

@Gimly great example. However it does not have Microsoft Graph API (which also should be used to pull extended properties from users) and delegation/access rights to another backend app. So properly frontend/angular (implicit flow) and backend can be devided...

@hkusulja Yes, I know it has still a few things to improve. I could add easily the Graph API since I did it in the app I'm working on, but I'm using a sample Azure AD B2C tenant and therefore can't add the permission to get info from the Graph API.

Delegation/access rights to another backend app, you mean from the .Net Core backend?

Feel free to add an issues for things you feel are missing directly on the repo and I'll look into it. You can also contribute if you are willing.

@Gimly So you are saying that it is not possible to get one OAuth2 token through implicit flow / angular2 from B2C AAD directory which also has a permission for:

Graph API, scope:xxx
mycustomServerBackend, scope: xxx
If so, any reference to do that?

This is normally working on "normal" AAD.

@hkusulja No, I'm not saying it's not possible, it's totally possible. It's just that I don't have to rights to the Azure B2C tenant I'm using in the sample and I'm not sure if they have added the rights for the app registration I'm using to use the Graph API. It's just a question of configuration.

@Gimly , I am sure, that if you have a Azure subscription for testing, you can create your own test Azure AD B2C , and inside it, create your applications with rights / Graph API...
I do not see way how to achieve access to Graph API and my custom backend...

So, any info about MSAL support for Angular 4+ ?

Bump, will Microsoft support the MSAL for Angular library?

@hkusulja There are plans in MSAL roadmap this year for an Angular library.

@hkusulja @Gimly @jraadt We have released @azure/msal-angular for angular 4.3+ and @azure/msal-angularjs for angular 1.7 on NPMJS. I am closing this issue.

Was this page helpful?
0 / 5 - 0 ratings