/m2m-demo-express

Primary LanguageJavaScriptMIT LicenseMIT

m2m-demo-express

License

English | 简体中文

Introduction

Node.js Express API Server quick start sample program.

Install dependencies

Run the following command to install the project dependencies:

$ npm install

Fill in your application configuration

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

Run this sample program:

$ npm start

Reference

Node.js Express API Server Quick Start

License

MIT

Copyright (c) 2019-present, Authing