Setting up OAuth with RapiDoc

Demo

Short Version

You are all set !!!

The Long story

Overall flow (Authorization Code)

Register client with Authorization Server

Setup Client

Client: This is the app's domain that host the html containing <rapi-doc> element.
In case of RapiDoc OAuth demo, since we host it from Github pages, it is https://mrin9.github.io

Below are the two files that our server must have

index.html (This is our main file that contains the <rapi-doc> element )
<!doctype html>
<head>
  <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>
  <rapi-doc spec-url = "https://mrin9.github.io/RapiDoc/specs/oauth.yaml" > 
  </rapi-doc>
</body>

oauth-receiver.html
the <oauth-receiver> custom element in this file, requests for an Authorization Code from Authorization Server by providing client_id and redirect URL. Upon receiving a valid auth-code, it passes to <rapi-doc> element. RapiDoc, then uses this Auth-Code to request for the Access Token .
<!doctype html>
<head>
  <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>

<body>
  <oauth-receiver> </oauth-receiver>
</body>