1.1.0 • Published 6 years ago

node-global-identity v1.1.0

Weekly downloads
99
License
-
Repository
github
Last release
6 years ago

node-global-identity

Global identity library for node.js.

How to install

npm install node-global-identity

Usage

Instantiating With Params

import GlobalIdentity from 'node-global-identity';

const gim = new GlobalIdentity({
  applicationKey: 'YOUR-APPLICATION-KEY',
  apiKey: 'YOUR-API-KEY',
  baseURL: 'GLOBAL-IDENTITY-URL',
});

or Setting Env Variables

export GLOBAL_APP_KEY=""
export GLOBAL_API_KEY=""
import GlobalIdentity from 'node-global-identity';

const gim = new GlobalIdentity();

Application Authorization

If you want to validate an application, you must encrypt a random string with the Client Application Secret Key.

gim.Authorization.validateApplication(
  ClientApplicationKey,
  RandomString,
  RandomEncryptedString
)

Authorization

* gim.Authorization.authenticateUser( email: string, password:string) : Promise
* gim.Authorization.validateToken (token: string): Promise
* gim.Authorization.renewToken (oldToken: string): Promise
* gim.Authorization.isUserInRoles (userKey:string, roles: [string]): Promise
* gim.Authorization.recoverPassword (email:string): Promise
* gim.Authorization.validateApplication (clientApplicationKey:string, rawData:string, encryptedData: string): Promise

Management

* gim.Management.addUser (email: string, fullName: string, comment?:string): Promise
* gim.Management.getUser (email: string)
* gim.Management.deleteUser (email: string)
* gim.Management.getUserRoles (email: string): Promise
* gim.Management.associateRolesToUser (email: string, roles: string[]): Promise
* gim.Management.dissociateUserFromRole (email: string, roleName: string): Promise

Global Identity API Documentation

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.2

8 years ago

0.1.0

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago