spike-get-token
v1.1.13
Published
This REPO is a Spike npm module that can be used to recieve oAuth tokens from Spike OAuth2 authorization server.
Downloads
18
Readme
Spike npm module: "spike-get-token"
This REPO is a Spike npm module that can be used to recieve oAuth tokens from Spike OAuth2 authorization server.
Usage
const getTokenCreator = require("spike-get-token");
const getToken = getTokenCreator(options);
// get token
const token = await getToken();
/** use token however ...
......................**/
Options For getTokenCreator
- redisHost: url to redis host
- ClientId: Spike given ClientId
- ClientSecret: Spike given ClientSecret
- spikeURL: url to Spike server instance
- tokenGrantType: type of grant requested from Spike for the access_token
- tokenAudience: access_token audience ( same as api )
- tokenRedisKeyName: key to save token in redis
- spikePublicKeyFullPath: path to Spike public key for jwt verification
- useRedis: (Boolean) set to true if usage of redis is required
- httpsValidation: (Boolean) set to true if you want to use https validation (default is false)
- hostHeader: (Boolean) add host header to the request (default is false)
- retries: (Number) amount of times to retry getting token (default is 3)
- sleepBetweenRetries: (Number) wait before doing next retry in milliseconds (default is 500)