0.1.1 • Published 3 years ago

azure-token-nonce v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Azure token nonce

License

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

Installation

With NPM :

npm install azure-token-nonce

With Yarn :

yarn azure-token-nonce

Usage

Configuration

import { AzureTokenNonce } from 'azure-token-nonce';

AzureTokenNonce.configure({
    tenantId: 'xxx',
    clientId: 'xxx',
    kid: 'xxx',
});
PropertyTypeRequiredDescription
tenantIdstringtrueUnique identifier of your tenant
clientIdstringtrueUnique identifier of your client
kidstringtrueUnique identifier of signing key (decode your token to retrieve it)
issuerstringfalseOverwrite issuer (default : https://sts.windows.net/<TENANT_ID>/)
jsonwebtokenjsonwebtoken.VerifyOptionsfalseAdditional properties for "jsonwebtoken" library
jwksClientjwksClient.ClientOptionsfalseOverwrite configuration of jwks client

Verify

// Express request as argument
await AzureTokenNonce.verifyToken(req);

🤝 Contributing

Contributions, issues and feature requests are welcome!

📝 License

This project is under MIT, feel free to fork.