cds-common-jwt-support
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i cds-common-jwt-support

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

476 kB

Total Files

27

Last publish

Collaborators

  • suntao