OAuth Hopper exposes OAuth2 services behind normal Basic Access Authentication so that you can access them through clients that don't support OAuth2. It is meant to run as a Cloudflare Worker.
- An OAuth2 token
- Create a new Cloudflare Worker
- Under "Settings", "Variables", Create the following Environment Variables:
CLIENT_ID- Your OAuth2 Client IDCLIENT_SECRETYour OAuth2 Client SecretHOSTNAME- The hostname of the resource you're trying to hop over. For example, Google's one isapidata.googleusercontent.comREFRESH_ENDPOINT- The refresh endpoint of your OAuth2 provider. For example, Google's one ishttps://www.googleapis.com/oauth2/v4/tokenREFRESH_TOKEN- Your latest refresh tokenUSERNAME- The username you want to connect withPASSWORD- The password you want to use when connecting
- Create a new Workers KV namespace, and under "KV Namespace Bindings" map it to a variable called
KEYS - In the the KV namespace, create a key called
access_tokenwith the following JSON value:{"token":"XYZ","expiry":0}(replaceXYZwith your latest access token) - Copy the content of index.js to your worker
- Connect to the resource using the URL of your Worker - OAuth Hopper will proxy the resource for you while hopping over OAuth!