AuthTS - Typescript Library for OAuth utilizing Implicit Flow
Introduction
AuthTS provides a wrapper for the functionallity explained here.
IMPORTANT NOTE: Implicit Flow is less secure than explicit flows. SSL is required for AuthTS to be secure.
Installation
npm install auth-ts
Basic Usage
To use this package, you must register an App in Azure Active Directory. You may then initialize the secure class like so:
;;
To login:
secure.login;
and to logout:
secure.logout;
Logging in will follow the implicit flow process and set a cookie in your browser with the returned JsonWebToken.
Secure has two public values: user & authorized. User contains the decoded jwt. Authorized is a boolean which indicates if a user is logged in or not.