1.1.0 • Published 6 years ago
azure-client v1.1.0
node-azure-client
This is a class that allows you to get authentication from azure active directory easily.
Constructor expects these parameters:
- authorityUrl - usually 'https://login.microsoftonline.com/8394d86a-a24c-4d2c-ad99-57a3d0bb7d89/oauth2/token'.
- clientId.
- clientSecret.
- resource - The name of the resource you want to access (something like 'http://prodhome1services/prodhome1someapi').
The only method is "getToken", which, as you could imagine, gets you an authentication token. You then use it as follows:
azureAdClient = new AzureAdClient(authorityUrl, clientId, clientSecret, resource);
const token = await azureAdClient.getAzureAdToken();
headers.Authorization = `Bearer ${token}`;