0.0.1 • Published 4 years ago
tekoid-nodejs-test v0.0.1
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 field | type | default |
---|---|---|
scope | array | "openid","profile" |
baseUri | string | https://oauth.tekoapis.com |
authorizePath | string | /oauth/authorize |
tokenPath | string | /oauth/token |
refreshTokenPath | string | /oauth/token |
revokeTokenPath | string | /oauth/revoke |
jwksPath | string | /.well-known/jwks.json |
verifySsl | boolean | true |
- 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
- getAuthorizationUrl():
- 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
0.0.1
4 years ago