1.0.3 • Published 4 years ago
sso-accesstrade v1.0.3
Access-Trade OAuth2
Node.js client library for OAuth2. OAuth2 Accesstrade allows users to grant access to restricted resources by third party applications.
Usage
Install the client library using npm:
npm install --save sso-accesstrade
Create a new instance by specifying the minimal configuration
import { OAuth2AccessTrade } from 'sso-accesstrade'
const OAuth2AT = new OAuth2AccessTrade( cliendId, secret, domain, pathToken, pathAuthorization, redirect_uri? )
cliendId
: Service registered client id. Requiredsecret
: Service registered client secret. Requireddomain
: Base URL used to obtain access tokens. Required. Example:http://domain.com
tokenPath
: URL path to obtain access tokens. Defaults to /oauth/tokenauthorizePath
: URL path to request an authorization code. Defaults to /oauth/authorize
OAuth2 Access-Trade Supported Functions
Grant_type password
const token = await OAuth2AT.getTokenGrantTypePassword(username, password, scope)
// Token response:
/**
* { access_token: '1ade83d8-d07d-4c96-a8bf-14f492110bc0',
token_type: 'bearer',
refresh_token: '50fa1cdc-96f2-4848-b1b7-48c5555dc0fd',
expires_in: 1547,
scope: 'user_info' }
*/
License
SSO AccessTrade 1.0