Skip to content

Commit

Permalink
updated URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-prasad committed May 9, 2024
1 parent 9e957ed commit b563524
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salesforceAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function generateJWT(federatedId) {
const payload = {
iss: '3MVG9XgkMlifdwVC7HpVYXbtS0.oqrzuNlp6zmZXDWtiIISFV.xfinfE12Ow_cRcE8fvA5eNGRmeZxSCUvXQ2',
sub: federatedId,
aud: 'https://login.salesforce.com',
aud: 'https://jpcom-2e-dev-ed.develop.my.site.com',
exp: Math.floor(Date.now() / 1000) + (3 * 60)
};

Expand All @@ -23,7 +23,7 @@ async function getSalesforceAccessToken(federatedId) {
const data = `grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=${token}`;

try {
const response = await axios.post('https://login.salesforce.com/services/oauth2/token', data, {
const response = await axios.post('https://jpcom-2e-dev-ed.develop.my.site.com/services/oauth2/token', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
return response.data.access_token;
Expand Down

0 comments on commit b563524

Please sign in to comment.