English | 简体中文
Node.js Express API Server quick start sample program.
Run the following command to install the project dependencies:
$ npm install
On line 12 of /app.js
, modify the configuration to your application configuration:
// Authorization middleware, Access token must exist and can be verified by Authing application public key
const checkJwt = jwt({
// Dynamically obtain the signature verification public key from the Authing application service discovery address
secret: jwksRsa.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: `https://{APP_DOMAIN}.authing.cn/oidc/.well-known/jwks.json`
}),
// Verify audience and issuer
audience: 'APP_ID',
issuer: [`https://{APP_DOMAIN}.authing.cn/oidc`],
algorithms: ['RS256']
});
Run this sample program:
$ npm start
Node.js Express API Server Quick Start
Copyright (c) 2019-present, Authing