Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to create new OAuth tokens #2031

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion docs/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,28 @@ stored as environment variables.
The variable names of Oauth2 credentials are "GITHUB_KEY" and "GITHUB_SECRET".
If running on heroku, set config variables by following instructions on [2].

If you need to set this up for your own instance, go to
<https://github.com/settings/applications/new>
to "Register a new OAuth application" and create a corresponding new token.
Here's how we created the "staging" token for staging.bestpractices.dev:

* Application Name: Best Practices Badge (Staging)
* Homepage URL: https://staging.bestpractices.dev
* Authorization callback URL: https://staging.bestpractices.dev/auth/github/callback
* We enabled "device flow" because it might be useful someday.

Similarly, here are the settings for the
"production" token for www.bestpractices.dev:

* Application Name: Best Practices Badge
* Homepage URL: https://www.bestpractices.dev
* Authorization callback URL: https://www.bestpractices.dev/auth/github/callback
* We enabled "device flow" because it might be useful someday.

You can see the status of these tokens on GitHub here:
<https://github.com/settings/developers>
under "OAuth applications".

If running locally, these variables need to be set up.
We have set up a file '.env' at the top level which has stub values,
formatted like this, so that it automatically starts up
Expand All @@ -616,7 +638,7 @@ GITHUB_KEY='client id' GITHUB_SECRET='client secret' rails s
where *client id* and *client secret* are registered OAuth2 credentials
of the app.

The authorization callback URL in GitHub is:
The authorization callback URL in GitHub for this dummy application is:
<http://localhost:3000/auth/github>

[1] <https://github.com/settings/applications/new>
Expand Down