Socket
Book a DemoInstallSign in
Socket

modular-adal-angular

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modular-adal-angular

Module shim for Azure AD's azure-activedirectory-library-for-js

2.1.0
latest
Source
npmnpm
Version published
Weekly downloads
43
975%
Maintainers
1
Weekly downloads
 
Created
Source

modular-adal-angular

This is a shim to bring module support to AzureAD's azure-activedirectory-library-for-js.

New in version 2.0

adal-angular is now a peerDependency, to allow future versions to be used with this shim (1.x).

Installation and Usage

First, install the package from npm into your application.

npm install --save modular-adal-angular adal-angular

Then import it into your application's code.

// ES5 require
var adalAngular = require('modular-adal-angular');

// ES6 import
import adalAngular from 'modular-adal-angular';

Finally, add it as a module dependency on your Angular application.

angular.module('myApp', [adalAngular]);

If you're not using Angular

If you're only using the AuthenticationContext (adal.js) part of the library, and do not need the Angular module (adal-angular.js), use the official adal-angular package. You can simply import it and assign it to window.AuthenticationContext.

window.AuthenticationContext = require('adal-angular');

Old versions of this shim

In versions <=0.3.0, this shim was a fork of the AzureAD library, with module support added inline. While this worked, it was difficult to maintain, especially as Microsoft updated their library.

Starting with version 1.0.0 of this shim, it now imports the official adal-angular library from npm and exports the Angular module name. This should allow easier updating of the underlying library, without rebases.

It also removes the dependency on Webpack's expose-loader, directly assigning the imported libary to window.AuthenticationContext. This should allow it to work with other bundlers.

Why do I need this, and why is AuthenticationContext on my window object?

The adal-angular library, at the time of this shims conception, did not support modules or expose any exports. This made it difficult to use with bundlers, such as Webpack. In anger, the library was forked, and module support was added inline, allowing it to be used with require(...) and import statements.

The Angular module in the library expects AuthenticationContext to be available on the window object. Additionally, at times during the authentication process, iframes may be also be spawned. These attempt to call window.parent.AuthenticationContext. As such, this module exposes AuthenticationContext on the window object, to prevent things breaking.

Keywords

oauth

FAQs

Package last updated on 02 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.