Skip to content

Instantly share code, notes, and snippets.

@gillesdemey
Created June 15, 2016 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gillesdemey/72aa9bf3159b791105e462d2e05cc955 to your computer and use it in GitHub Desktop.
Save gillesdemey/72aa9bf3159b791105e462d2e05cc955 to your computer and use it in GitHub Desktop.
// get tokens for provider from user (profile)
function getTokens (provider, profile) {
var tenant = options.globalSettings.HOARD_TENANT
var secret = options.globalSettings.HOARD_SECRET
var jwt_token = jwt.sign({ sub: profile, iss: tenant }, secret)
return request(`https://auth.waylay.io/tokens/${provider}`, {
headers: { 'authorization': jwt_token }
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment