Blog: https://yu-jack.github.io/2020/04/27/oauth-implement/
OAuth Example Node.js Version
Node Version: 10+
- modiyfy /etc/hosts with following setting, and run
npm install127.0.0.1 printer.example.com 127.0.0.1 photo.example.net
node client/server.jsnode resource_server/server.js- go to
http://printer.example.com:4000/to use OAuth login, username: 123, password: 123. - go to
http://photo.example.net:3000/and upload photo - go back to
http://printer.example.com:4000/, you'll see the pohotos.