# adal-angular-ts

> AdalJS rewrite in Typescript for Angular7.X

Latest version **7.0.5** (published 2021-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install adal-angular-ts
pnpm add adal-angular-ts
yarn add adal-angular-ts
bun add adal-angular-ts
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.5 |
| Published | 2021-01-28 |
| First published | 2017-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 861 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Albany International Corp. |
| Maintainers | albany-international-corp |

## Links

- npm: https://www.npmjs.com/package/adal-angular-ts
- Repository: https://github.com/AlbanyInternationalCorp/Adal-Angular-TS
- Homepage: https://github.com/AlbanyInternationalCorp/Adal-Angular-TS#readme
- Issues: https://github.com/AlbanyInternationalCorp/Adal-Angular-TS/issues
- npm.io page: https://npm.io/package/adal-angular-ts

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 7.0.5 (latest) — 2021-01-28
- 7.0.4 — 2021-01-27
- 7.0.3 — 2021-01-27
- 7.0.2 — 2020-09-08
- 7.0.1 — 2020-08-04
- 7.0.0 — 2018-12-27
- 6.1.0 — 2018-07-27
- 6.0.3 — 2018-05-25
- 6.0.2 — 2018-05-25
- 6.0.1 — 2018-05-05
- 6.0.0 — 2018-05-05
- 1.1.6 — 2018-02-04
- 1.1.5 — 2018-02-01
- 1.1.4 — 2018-01-03
- 1.1.3 — 2017-12-18
- … 49 more at https://npm.io/package/adal-angular-ts/versions

## README

<!--TODO: Add how to use interceptor -->
[![npm version](https://badge.fury.io/js/adal-angular-ts.svg)](https://badge.fury.io/js/adal-angular-ts)
![npm license](https://img.shields.io/npm/l/express.svg)

# adal-angular-ts
A typescript library that allows you to authenticate against Azure Active Directory. 

**NOTE:** There is a newer Microsoft library called MSAL (https://github.com/AzureAD/microsoft-authentication-library-for-js).
For *most* usage, the MSAL library will fit your needs. However, if your usage still requires ADAL (if directly targeting ADFS 2016 or older, for example)
and you have a need for TypeScript support, then this library is still a good fit.

Version 6.0.0 ^ supports Angular 6.0.0. For Support for Angular `2.0.0 > & < 6.0.0` run `npm i adal-angular-ts@1.1.6`.

Version 7.0.0 ^ supports Angular 7.0.0. For Support for Angular `6.0.0 > & < 7.0.0` run `npm i adal-angular-ts@6.1.0`.

This library was built using [Angular CLI](https://github.com/angular/angular-cli/wiki/stories-create-library).

## Installation
```
npm i adal-angular-ts
```


## Example Usage

### Add Module to Bootstrap of Application
```
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { AdalAngularTSModule, TokenInterceptor } from "adal-angular-ts";

const adalConfig = {
  clientId: '11111111-1111-1111-1111-11111111111',
  tenant: 'companyName.onmicrosoft.com',
  redirectUri: null,
  postLogoutRedirectUrl: window.location.origin,
  instance: 'https://login.microsoftonline.com/',
};

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AdalAngularTSModule.forRoot(adalConfig)
  ],
  // Adding TokenInterceptor will automatically assign the bearer token to all requests
  providers: [
        {
            provide: HTTP_INTERCEPTORS,
            useClass: TokenInterceptor,
            multi: true,
        }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

### Call Login in desired component
```
import { Component } from '@angular/core';
import { AdalAngularTSService } from "adal-angular-ts";

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';
  constructor(
    private adalService: AdalAngularTSService
  ){
    this.adalService.login();
  }
}
```


## Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. 

## Contributing

Pull requests are welcome!

---
_Source: https://npm.io/package/adal-angular-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
