
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
oc-plugin-jwt
Advanced tools
OpenComponents plugin for validating JSON Web Token (JWT) inside OC components.
npm i oc-plugin-jwt --save
More info about integrating OC plugins: here
Registering using the simple in-memory keystore.
const registry = oc.registry(configuration);
registry.register(
{
name: 'jwtVerify',
register: require('oc-plugin-jwt').verify,
options: {
keys: {
'key-id-1': {
publicKey: fs.readFileSync('certificate.pem')
},
'key-id-2': {
secret: 'super-secret-password'
}
}
}
}
);
registry.start(callback);
Or custom using a custom keystore
const registry = oc.registry(configuration);
registry.register(
{
name: 'jwtVerify',
register: require('oc-plugin-jwt').verify,
options: {
keyStore: {
getSecretOrPublicKey(keyId, callback) {
// Get the public key or secret by some method
return callback(null, key);
}
}
}
}
);
registry.start(callback);
Example for a component's server.js:
module.exports.data = (context, callback) => {
const exampleToken =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleS1pZC0yIn0.' +
'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.' +
'bQVxleqAX7NQzI_RkIPFVfTl44-iEY0UYPUBm10789o';
context.plugins.jwtVerify(exampleToken, (error, verifiedToken) => {
if (error) {
// Handle token verification errors
callback(error);
}
callback(null, { verifiedToken: verifiedToken });
});
};
FAQs
OpenComponents Plugin for Verifying & Decoding JSON Web Tokens (JWT)
We found that oc-plugin-jwt 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.