https://github.com/authing/m2m-demo-express
Node.js Express API Server quick start sample program.
https://github.com/authing/m2m-demo-express
authing m2m
Last synced: about 1 month ago
JSON representation
Node.js Express API Server quick start sample program.
- Host: GitHub
- URL: https://github.com/authing/m2m-demo-express
- Owner: Authing
- License: mit
- Created: 2022-07-27T06:39:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-12T08:46:26.000Z (over 3 years ago)
- Last Synced: 2023-03-01T20:25:57.956Z (almost 3 years ago)
- Topics: authing, m2m
- Language: JavaScript
- Homepage: https://docs.authing.cn/v2/quickstarts/apiServer/nodeJsExpress/
- Size: 21.5 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# m2m-demo-express
**English** | [简体中文](./README.zh-CN.md)
## Introduction
Node.js Express API Server quick start sample program.
## Install dependencies
Run the following command to install the project dependencies:
```bash
$ npm install
```
## Fill in your application configuration
On line 12 of `/app.js`, modify the configuration to your application configuration:
```js
// 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:
```bash
$ npm start
```
## Reference
[Node.js Express API Server Quick Start](https://docs.authing.cn/v2/quickstarts/apiServer/nodeJsExpress)
## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2019-present, Authing