Socket
Socket
Sign inDemoInstall

cds-common-jwt-support

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cds-common-jwt-support

support common jwt with jose for @sap/cap


Version published
Maintainers
1
Install size
465 kB
Created

Readme

Source

cds common jwt support

support jwt without xsuaa ans xssec, and give user much more features with jose

node-test codecov npm

Quality Gate Status Security Rating Vulnerabilities

Get Started

simply integrate the cds-common-jwt-support to you CAP nodejs project

npm i -S cds-common-jwt-support jose

server.js

const cds = require("@sap/cds");
const { configureJwt } = require("cds-common-jwt-support");
const jose = require("jose")

const publicKey = `
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7g4mOYr136bOzOB4hd+e
......
-----END PUBLIC KEY-----
`

cds.on("bootstrap", async (app) => {
  configureJwt(app, {
    key: await jose.importSPKI(publicKey, "PS256")
  });
});

module.exports = cds.server;

package.json

{
  "requires": {
    "auth": {
      "kind": "common-jwt"
    },
    "common-jwt": {
      "impl": "cds-common-jwt-support"
    }
  }
}

CHANGELOG

LICENSE

Keywords

FAQs

Last updated on 13 Apr 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc