0.0.1 • Published 4 years ago

tekoid-nodejs-test v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

tekoid-nodejs

How to install

  • use pip:
    npm i tekoid-nodejs

How to use

  • First, import ClientSDK into your sourcecode. I.E:
import {Config, ClientSDK} from "tekoid-nodejs"
  • Second, you need to instantiate ClientSDK. See example:
const config: Config = {
    clientId: "id",
    clientSecret: "secret",
    redirectUri: "http://localhost:5000/callback"
}

clientSDK = new ClientSDK(config)

Note: redirectUri must be declare in iam admin system

addition fieldtypedefault
scopearray"openid","profile"
baseUristringhttps://oauth.tekoapis.com
authorizePathstring/oauth/authorize
tokenPathstring/oauth/token
refreshTokenPathstring/oauth/token
revokeTokenPathstring/oauth/revoke
jwksPathstring/.well-known/jwks.json
verifySslbooleantrue
  • Support function:
    • getAuthorizationUrl():
      • return url, state

    • getToken(url, state):
      • use for authorization code flow, pass url get from authorization server and state get above
      • return token data

    • getToken():
      • use for client credentials flow
      • return token data

    • getUserInfo(token):
      • pass id_token get above
      • return user data
    • refreshToken(refresh_token):
      • pass refresh token get from get_token()
      • return new token data

  • you can see the sample code at https://github.com/teko-vn/tekoid-nodejs/blob/master/example/app.ts

Support

  • vietnk: viet.nk@teko.vn