1.1.0 • Published 1 year ago
@an1mal/azure-easy-auth-helper v1.1.0
Helper functions for Azure App Service built-in authentication and authorization ("Easy Auth").
Read more: https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization
Getting Started
Install package using npm
npm install @an1mal/azure-easy-auth-helper
or yarn
yarn add @an1mal/azure-easy-auth-helper
Usage
import { getAuthMe } from '@an1mal/azure-easy-auth-helper';
const base_url = 'https://your-azure-app.azurewebsites.net';
const user = getAuthMe(base_url);
Running in local environment or tests
mock_user = true;
const user = getAuthMe(base_url, mock_user);
NOTE: Only works on client-side.
License
MIT