
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
salesforce-jwt-promise
Advanced tools
Promise Based SalesForce Auth 2.0 JWT Bearer Token Flow Implementation, written in typescript
Promise Based implementation of OAuth 2.0 JWT Bearer Token Flow.
async/await
syntax.$ npm install salesforce-jwt-promise
This library contains an single export: getJWTToken()
which accepts an object with the following options object parameter:
clientId
: The salesforce connected app consumerKeyprivateKey
: The private key used to sign the certificated uploaded to the connected appuserName
: The user to impersonateaudience
: (Optional) Defaults to https://login.salesforce.cominstance_url
: (Optional) Defaults to audience
A success response will include the following properties:
import { getJWTToken } from 'salesforce-jwt-promise';
var clientId = '3MVG9A2kN3Bn17hvVNDOE5FX8c9hS...30dgSSfyGi1FS09Zg';
var privateKey = require('fs').readFileSync('./privateKey.key', 'utf8'); // this should probably be encrypted!
try{
let jwtResp = await getJWTToken(
{
clientId: clientId,
privateKey: privateKey,
userName: 'user@toImpersonate.com',
audience: 'https://test.salesforce.com'
}
);
//use token
var sfConnection = new jsforce.Connection();
sfConnection.initialize({
instanceUrl: jwtResp.instance_url,
accessToken: jwtResp.access_token
});
}catch(e){
console.log(e);
}
MIT
Forked from leandrob/node-salesforce-jwt
FAQs
Promise Based SalesForce Auth 2.0 JWT Bearer Token Flow Implementation, written in typescript
The npm package salesforce-jwt-promise receives a total of 117 weekly downloads. As such, salesforce-jwt-promise popularity was classified as not popular.
We found that salesforce-jwt-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.