This is a quick 3-legged OAuth implicit grant flow demo that runs using client-side JavaScript with the RingCentral JavaScript SDK v3.2.0.
$ git clone https://github.com/ringcentral-tutorials/oauth-implicit-js-demo.git
cd oauth-implicit-js-demoEdit the ./public/config.js file to configure your client ID and redirect URL, etc.
$ cd ./public
$ cp config-sample.js config.js
$ vi config.jsIn the Developer Portal, ensure the redirect URI in your config file has been entered in your app configuration. By default, the URL is set to the following for this demo:
http://localhost:8080/callback.html
Serve the static page with http-server:
$ npm install -g http-server
$ http-server publicYou can also serve the static pages with nginx or apache as you like.
Go to the URL:
http://localhost:8080
Then click the Login with RingCentral button to authorize the demo app and view the access token. Click the Renew Access Token button to renew the access token.