Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/msal-angular

Package Overview
Dependencies
Maintainers
3
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-angular - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.json

102

package.json

@@ -13,3 +13,3 @@ {

},
"version": "1.0.0",
"version": "1.1.0",
"keywords": [

@@ -22,26 +22,100 @@ "implicit",

],
"main": "bundles/azure-msal-angular.umd.js",
"typings": "azure-msal-angular.d.ts",
"main": "./dist/bundles/azure-msal-angular.umd.js",
"typings": "./dist/azure-msal-angular.d.ts",
"engines": {
"node": ">=0.8.0"
},
"ngPackage": {
"lib": {
"entryFile": "public_api.ts"
},
"whitelistedNonPeerDependencies": [
"minimatch",
"path"
]
},
"peerDependencies": {
"@angular/common": ">= 6.0.0",
"@angular/core": ">= 6.0.0",
"msal": "^1.3.0",
"rxjs": "^6.0.0",
"tslib": "^1.10.0"
"msal": "^1.4.0",
"rxjs": "^6.0.0"
},
"devDependencies": {
"@angular/common": "^9.0.2",
"@angular/compiler": "^9.0.2",
"@angular/compiler-cli": "^9.0.2",
"@angular/core": "^9.0.2",
"@angular/platform-browser": "^9.0.2",
"@angular/platform-browser-dynamic": "^9.0.2",
"@angular/router": "^9.0.2",
"@types/handlebars": "4.0.33",
"@types/jasmine": "2.5.41",
"@types/jasmine-ajax": "^3.1.35",
"angular-router-loader": "^0.8.5",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^3.5.0",
"babel-polyfill": "^6.26.0",
"bluebird": "^3.5.1",
"core-js": "^2.4.1",
"gh-pages": "^2.2.0",
"grunt": "^1.0.3",
"grunt-banner": "^0.6.0",
"grunt-contrib-uglify": "^2.3.0",
"grunt-exec": "^2.0.0",
"grunt-file-append": "0.0.7",
"grunt-jasmine-node": "~0.3.1",
"grunt-tslint": "^5.0.1",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "^3.5.0",
"jasmine-ajax": "^3.3.1",
"jasmine-core": "^3.5.0",
"jasmine-node": "2.0.1",
"karma": "^3.1.4",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "^2.0.1",
"karma-phantomjs-launcher": "*",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.32",
"karma-verbose-reporter": "0.0.6",
"karma-webpack": "^3.0.0",
"msal": "^1.4.0",
"ng-packagr": "^9.0.2",
"phantomjs-polyfill": "0.0.2",
"reflect-metadata": "^0.1.3",
"rxjs": "^6.5.4",
"shx": "^0.2.2",
"source-map-loader": "^0.2.3",
"ts-loader": "^2.0.3",
"tslib": "^1.11.1",
"tslint": "^5.8.0",
"typedoc": "^0.14.2",
"typescript": "^3.6.5",
"typings": "^2.1.1",
"webpack": "3.6.0",
"zone.js": "^0.8.10"
},
"directories": {
"test": "tests"
},
"scripts": {
"clean": "shx rm -rf dist ref",
"doc": "npm run doc:generate && npm run doc:deploy",
"doc:generate": "typedoc --mode modules --excludePrivate --excludeProtected --out ./ref ./src/ --gitRevision dev",
"doc:deploy": "gh-pages -d ref -a -e ref/msal-angular",
"build:modules": "ng-packagr -p package.json",
"build": "npm run clean && npm run build:modules",
"deploy": "npm run build && npm publish dist && npm run doc",
"test": "karma start karma.conf.js",
"lint": "tslint -p ./",
"test:verify-build": "npm run build:modules && npm test",
"endToEnd": "cd tests/endToEndTests && npm install && node testRunner.js",
"prepack": "npm run build"
},
"description": "Microsoft Authentication Library for Angular",
"module": "fesm5/azure-msal-angular.js",
"es2015": "fesm2015/azure-msal-angular.js",
"esm5": "esm5/azure-msal-angular.js",
"esm2015": "esm2015/azure-msal-angular.js",
"fesm5": "fesm5/azure-msal-angular.js",
"fesm2015": "fesm2015/azure-msal-angular.js",
"metadata": "azure-msal-angular.metadata.json",
"sideEffects": false
"dependencies": {
"minimatch": "^3.0.4",
"path": "^0.12.7"
}
}

66

README.md

@@ -35,6 +35,6 @@ # Microsoft Authentication Library for Angular

* [B2C Angular SPA](https://github.com/Azure-Samples/active-directory-b2c-javascript-angular-spa)
* [Angular v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/angular6-sample-app)
* [Angular v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/angular7-sample-app)
* [Angular v8](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/angular8-sample-app)
* [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/angular9-sample-app)
* [Angular v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-samples/angular6-sample-app)
* [Angular v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-samples/angular7-sample-app)
* [Angular v8](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-samples/angular8-sample-app)
* [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-samples/angular9-sample-app)

@@ -90,12 +90,28 @@ ## Usage

MSAL Angular allows you to add an Http interceptor (`MsalInterceptor`) in your `app.module.ts` as follows. MsalInterceptor will obtain tokens and add them to all your Http requests in API calls except the API endpoints listed as `unprotectedResources`.
MSAL Angular allows you to add an Http interceptor (`MsalInterceptor`) in your `app.module.ts` as follows. MsalInterceptor will obtain tokens and add them to all your Http requests in API calls based on the `protectedResourceMap`.
```js
providers: [
ProductService, {
provide: HTTP_INTERCEPTORS,
useClass: MsalInterceptor,
multi: true
}
],
@NgModule({
imports: [
MsalModule.forRoot({
auth: {
clientId: "Your client ID"
}
}, {
protectedResourceMap: [
['https://graph.microsoft.com/v1.0/me', ['user.read']],
['https://api.myapplication.com/users/*', ['customscope.read']]
]
})
],
providers: [
ProductService,
{
provide: HTTP_INTERCEPTORS,
useClass: MsalInterceptor,
multi: true
}
]
})
export class AppModule {}
```

@@ -105,6 +121,16 @@

As of `@azure/msal-angular@1.1.0`, `protectedResourceMap` supports wildcard patterns that are supported by [minimatch](https://github.com/isaacs/minimatch), and `unprotectedResources` is deprecated and ignored.
**Note:** When using wildcards, if multiple matching entries are found in the `protectedResourceMap`, the first match found will be used (based on the order of the `protectedResourceMap`).
### 4. Subscribe to event callbacks
MSAL wrapper provides below callbacks for various operations. For all callbacks, you need to inject BroadcastService as a dependency in your component/service.
MSAL wrapper provides below callbacks for various operations. For all callbacks, you need to inject BroadcastService as a dependency in your component/service and also implement a `handleRedirectCallback`:
```js
this.authService.handleRedirectCallback((authError, response) => {
// do something here
});
```
1. Login-related events (`loginPopup`/`loginRedirect`)

@@ -203,3 +229,3 @@

piiLoggingEnabled: true,
}
}),
}

@@ -223,3 +249,3 @@ })]

MSAL will get access tokens using a hidden Iframe for given CORS API endpoints in the config. To make CORS API call, you need to specify your CORS API endpoints as a map in the config.
MSAL will get access tokens using a hidden Iframe for given CORS API endpoints in the config. To make CORS API call, you need to specify your CORS API endpoints as a map in the Angular config.

@@ -237,6 +263,5 @@ ```js

clientId: 'Your client ID',
},
framework: {
protectedResourceMap : protectedResourceMap
}
}, {
protectedResourceMap : protectedResourceMap
})

@@ -270,5 +295,4 @@ ]

}
framework: {
popUp: !isIE
}
}, {
popUp: !isIE
});

@@ -275,0 +299,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc