1.0.6 • Published 6 years ago

bordino-authenticate v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

bordino-authenticate

/!\ This package is used and maintained by the DSITN Innovation

Installation

  npm install --save bordino-authenticate

Usage

const BordinoAuthenticate = require('bordino-authenticate')
//or
import BordinoAuthenticate from 'bordino-authenticate';

const conf = {authServerURL: 'http://myAuthServer/'}

const bordinoAuthenticate = BordinoAuthenticate(conf)

there is two main functionnality :

  • Login
  • validateToken

Interally use axios package to do the requests and return Promise

Login

accept a password as param and return a validate token to ensure authentification to the services.

  bordinoAuthenticate.login('mypassword')
                     .then((token)=>{
                       //use the token
                     })
                     .catch((e)=>(
                       //handle error
                     ))

ValidateToken

accept a token previously get from login or passed and return if the token is valide to ensure authentification to the services.

  bordinoAuthenticate.validateToken('mytoken')
                     .then((isValide)=>{
                       //do your job
                     })
                     .catch((e)=>(
                       //handle error
                     ))
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago