1.0.1 • Published 5 years ago

oib2b-gateway-auth v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

OIB2B GATEWAY AUTH

OIB2B GATEWAY AUTH is a NodeJs library for authenticate users and retrieve user from access token.

Installation

Use the package manager npm or yarn to install.

npm i --save oib2b-gateway-auth

or

yarn add oib2b-gateway-auth

Usage

const Auth = require('oib2b-gateway-auth');

const auth = new Auth('GATEWAY_URL');

auth.login({ username, password })
	.then(res => console.log(res)) //The response object contains the user and a new access token.
	.catch(err => console.log(err));

auth.whois('ACCESS_TOKEN')
    .then(res => console.log(res)) //The response object is the owner/user of the access token.
    .catch(err => console.log(err));

Authors

See also the list of contributors who participated in this project.

License

MIT