A typescript library that allows you to authenticate against Azure Active Directory
aka adal.js typescript rewrite
- 100% typescript
- 80% code coverage
- easy to install, no dependencies.
npm install adal-ts --save
v0.6.0 adds support for access tokens for use with implicit auth flow against AAD and Office365 link
- login to Azure Active Directory
- get the logged in user
- logout to Azure Active Directory
- allow to retrieve the token from storage (ex: apply it to header)
let config = new AdalConfig('clientID', 'unittest.onmicrosoft.com', 'http://localhost');
let context = Authentication.getContext(config);
context.login();
...
//to process the redirect after login, place this inside your root component (ex: NG2 AppComponent.ngOnInit)
Authentication.getAadRedirectProcessor().process();
let config = new AdalConfig('clientID', 'unittest.onmicrosoft.com', 'http://localhost');
let context = Authentication.getContext(config);
let user = context.getUser();
let config = new AdalConfig('clientID', 'unittest.onmicrosoft.com', 'http://localhost');
let context = Authentication.getContext(config);
context.logout();
let config = new AdalConfig('clientID', 'unittest.onmicrosoft.com', 'http://localhost');
let context = Authentication.getContext(config);
let token = context.getToken();
login with:
user: guestone@hneu70532.onmicrosoft.com
pwd: Test1234
source: adal-ts-consumer
If you have found a bug or if you have a feature request, please report them at this repository issues section.
Pull requests are welcome!
Use webpack
to compile and build. A /dist
folder is generated.
npm run webpack
Use npm test
cmd to compile and run all tests. After the tests have run a /coverage folder is generated. Drill down to index.html to see the results.
Use npm test
cmd to compile and run all tests. Test runner is configured with autowatching and 'progress' as test reporter.