Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@sap/node-jwt
Advanced tools
JSON Web Token (JWT) offline validation for Node with current binaries
This project contains the JWT binding for Node.js. It also includes the native libraries to run on Windows/Linux. If you need another platforms, please write to the author.
Supported platforms: Windows | Linux | MacOS Supported architectures: x64 on all platforms. Please see also section dependencies for Node.js version.
This standard example is from http://jwt.io
// you can either load a HMAC key for signatures with HSxxx
v.setSecret("secret"); // load HMAC key
v.setBase64Secret("c2VjcmV0"); // load a Base64 encoded HMAC key
// or you can load a PEM encoded X509 certificate for signatures with RSxxx
v.loadPEM("MIICozCCAYsCCAogFQcmCUcJMA0GCSqGSIb3DQEBCwUAMBQ...."); // load X509 public certificate OR public key for RSA signature validation
// check the token signature and validity
v.checkToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ");
console.log("Test JWT for Node.js");
if (v.getErrorDescription() !== "") {
// error handling
console.log("Error in JWT: " + v.getErrorDescription());
} else {
// in case of success, retrieve the payload
console.log("JWT Payload : " + v.getPayload());
}
From your project directory, run (see below for requirements):
$ var jwt = require('@sap/node-jwt');
Released versions
npm config set registry http://npm.sap.com
npm install @sap/node-jwt
node-gyp
or any compiler (e.g. Visual Studio on Windows). The source code and binding.gyp is part of this project in case of errors.The standard error for signature operations is the situation, that the signature is not valid. This error is typical and you should handle it carefully! and not as fatal error or assert. If you think, it must work, but it does not, then you can trace the native functions. SAPSSOEXT library allows you to set the environment variables:
set SAP_EXT_TRC=stdout
set SAP_EXT_TRL=3
If you run your application in CloudFoundry or XSA then you can define environment variables with client command tool cf / xs, see https://docs.run.pivotal.io/devguide/deploy-apps/manifest.html#env-block
In cf landscapes you can then cf logs and you will see trace from JWT validation
In order to configure the sap NPM registry you need to issue the following command:
npm config set registry http://npm.sap.com
npm install @sap/node-jwt
FAQs
JWT validation library for Node.js
The npm package @sap/node-jwt receives a total of 180 weekly downloads. As such, @sap/node-jwt popularity was classified as not popular.
We found that @sap/node-jwt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.