Reputation: 511
I'm searching for a secure and popular way to use Azure Active Directory with an Angular 5 app. Angular 5 and .Net Core if it makes a difference.
I see that a common way to do this is using this wrapper package (adal-angular4). It seems to cover Angular 4, 5, and 6.
I'm new to wrappers, and my main concern is: would they be allowed in business settings? Are there any other more "professional" ways of using Azure AD with Angular 5? Should I look for other alternatives, like the Microsoft ADAL.js for JavaScript?
Upvotes: 0
Views: 605
Reputation: 1033
Best way to do it, might be to create an Adal service to encapsulate logic and inject into other components that require authentication:
import { Injectable } from '@angular/core';
import * as AuthenticationContext from 'adal-angular';
const authContextFn: AuthenticationContext = AuthenticationContext;
@Injectable()
export class AdalService {
private adalContext: AuthenticationContext;
constructor() {
this.adalContext = new authContextFn();
}
}
Upvotes: 1