cds-common-jwt-support
v0.0.2
Published
support common jwt with jose for @sap/cap
Downloads
5
Readme
cds common jwt support
support
jwt
without xsuaa ans xssec, and give user much more features withjose
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"
}
}
}