Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function makeRefreshTokenRequest(configuration, code) {
// use the code to make the token request.
let request = new TokenRequest(
idpConfig.clientId, idpConfig.redirectUri, GRANT_TYPE_AUTHORIZATION_CODE, code, undefined, {'client_secret': idpConfig.clientSecret});
return tokenHandler.performTokenRequest(configuration, request).then(response => {
logger.info('retrieved oauth2 refresh token', {category: 'openid-connect'});
return response;
});
}
function makeAccessTokenRequest(configuration, refreshToken) {
let request = new TokenRequest(
idpConfig.clientId, idpConfig.redirectUri, GRANT_TYPE_REFRESH_TOKEN, undefined, refreshToken, {'client_secret': idpConfig.clientSecret});
return tokenHandler.performTokenRequest(configuration, request).then(response => {
logger.info('retrieved oauth2 access token', {category: 'openid-connect'});
return response;
});
}