auth-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

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:

import * as Auth from 'auth-ts'
 
const APP_ID: string = 'my-app-token';
const secure = new Auth.Secure(APP_ID);

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.

Readme

Keywords

none

Package Sidebar

Install

npm i auth-ts

Weekly Downloads

9

Version

1.0.6

License

ISC

Unpacked Size

28.8 kB

Total Files

27

Last publish

Collaborators

  • henrywalters20