-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 02de379
Showing
11 changed files
with
3,541 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CLIENT_ID=XXXXX | ||
CLIENT_SECRET=XXXX | ||
|
||
PLUGIN_URI=https://localhost:5174 | ||
REDIRECT_URI=http://localhost:8787/redirect | ||
|
||
AUTHORIZE_ENDPOINT=https://accounts.google.com/o/oauth2/v2/auth | ||
TOKEN_ENDPOINT=https://oauth2.googleapis.com/token | ||
|
||
SCOPE=https://www.googleapis.com/auth/userinfo.profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Deploy Worker | ||
on: | ||
push: | ||
pull_request: | ||
repository_dispatch: | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build & Deploy Worker | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# dependencies | ||
node_modules/ | ||
.pnp | ||
.pnp.js | ||
.yarn | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
.wrangler/ | ||
|
||
# files | ||
my-plugin | ||
dev-plugin | ||
dist | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
.dev.vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OAuth Backend for Framer Plugins | ||
|
||
This is an example CloudFlare Worker that proxies OAuth 2.0 login requests and handles token communication with a Framer plugin. | ||
|
||
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/framer/plugin-oauth) | ||
|
||
## Setup | ||
|
||
### Environment variables | ||
|
||
The following environment variables need to be added via the CloudFlare console or CLI. | ||
|
||
| Name | Details | | ||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------- | | ||
| CLIENT_ID | App ID created in the providers developer console | | ||
| CLIENT_SECRET | App secret key created in the providers developer console. **Do not expose** in source code or send back to the client! | | ||
| PLUGIN_URI | Root path of where your plugin is hosted | | ||
| REDIRECT_URI | Callback path that provider will redirect to after logging in | | ||
| AUTHORIZE_ENDPOINT | Provider endpoint path for showing the log in screen | | ||
| TOKEN_ENDPOINT | Provider endpoint path for fetching and refreshing access tokens | | ||
| SCOPE | Provider permissions separated by a space | | ||
|
||
To test locally, create a `.dev.vars` file with your own `CLIENT_ID` and `CLIENT_SECRET`. |
Oops, something went wrong.