Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d-corler/azure-token-nonce
Verify token provided by AzureAD with V2 endpoint (compatible with nonce property)
https://github.com/d-corler/azure-token-nonce
Last synced: about 2 months ago
JSON representation
Verify token provided by AzureAD with V2 endpoint (compatible with nonce property)
- Host: GitHub
- URL: https://github.com/d-corler/azure-token-nonce
- Owner: d-corler
- Created: 2020-11-14T15:21:32.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T19:06:41.000Z (about 2 years ago)
- Last Synced: 2024-09-14T01:07:52.264Z (4 months ago)
- Language: TypeScript
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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//) |
| `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.