# azure-token-nonce

> Verify token provided by AzureAD with V2 endpoint (compatible with nonce property)

Latest version **0.1.1** (published 2020-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install azure-token-nonce
pnpm add azure-token-nonce
yarn add azure-token-nonce
bun add azure-token-nonce
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-11-14 |
| First published | 2020-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Damien CORLER |
| Maintainers | dcorler |
| Keywords | verify, azure, token, nonce |

## Links

- npm: https://www.npmjs.com/package/azure-token-nonce
- Repository: https://github.com/d-corler/azure-token-nonce
- Homepage: https://github.com/d-corler/azure-token-nonce#readme
- Issues: https://github.com/d-corler/azure-token-nonce/issues
- npm.io page: https://npm.io/package/azure-token-nonce

## Dependencies (4)

- [sha2](https://npm.io/package/sha2.md) ^1.0.2
- [jwks-rsa](https://npm.io/package/jwks-rsa.md) ^1.11.0
- [base64url](https://npm.io/package/base64url.md) ^3.0.1
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1

## Recent versions

- 0.1.1 (latest) — 2020-11-14
- 0.1.0 — 2020-11-14

## README

# Azure token nonce

[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://spdx.org/licenses/MIT.html)

> Verify token provided by AzureAD with V2 endpoint (compatible with nonce property)

## Installation

With NPM :
```sh
npm install azure-token-nonce
```

With Yarn :
```sh
yarn azure-token-nonce
```

## Usage

### Configuration

```ts
import { AzureTokenNonce } from 'azure-token-nonce';

AzureTokenNonce.configure({
    tenantId: 'xxx',
    clientId: 'xxx',
    kid: 'xxx',
});
```

| Property       | Type                         | Required | Description                                                         |
| -------------- | ---------------------------- | -------- | ------------------------------------------------------------------- |
| `tenantId`     | `string`                     | `true`   | Unique identifier of your tenant                                    |
| `clientId`     | `string`                     | `true`   | Unique identifier of your client                                    |
| `kid`          | `string`                     | `true`   | Unique identifier of signing key (decode your token to retrieve it) |
| `issuer`       | `string`                     | `false`  | Overwrite issuer (default : https://sts.windows.net/<TENANT_ID>/)   |
| `jsonwebtoken` | `jsonwebtoken.VerifyOptions` | `false`  | Additional properties for "jsonwebtoken" library                    |
| `jwksClient`   | `jwksClient.ClientOptions`   | `false`  | Overwrite configuration of jwks client                              |

### Verify

```ts
// Express request as argument
await AzureTokenNonce.verifyToken(req);
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome!

## 📝 License

This project is under [MIT](https://spdx.org/licenses/MIT.html), feel free to fork.

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