Create a GitHub OAuth app for OpenConnector
Use a GitHub OAuth app when OpenConnector needs a user-authorized GitHub connection. GitHub also supports personal access tokens, but OAuth is better when you want an authorization flow instead of manually pasting a token.
OpenConnector service
| Service ID | Provider | Auth type |
|---|---|---|
github | GitHub | OAuth2 |
OpenConnector’s GitHub OAuth provider can request scopes such as read:user, user:email, repo, workflow, and delete_repo. Grant only the scopes you need for the actions you plan to run.
Prerequisites
- A running OpenConnector runtime.
- A GitHub account or organization where you can create OAuth apps.
- The OpenConnector origin users open in the browser, such as
http://localhost:3000orhttps://connect.example.com.
Step 1: Set the OpenConnector callback URL
Build the callback URL by appending /oauth/callback to your OpenConnector origin. For local testing, use http://localhost:3000/oauth/callback. For a public deployment, set OOMOL_CONNECT_ORIGIN, restart OpenConnector, and use the public callback URL, such as https://connect.example.com/oauth/callback.
Step 2: Register a GitHub OAuth app
In GitHub:
- Open Settings.
- Open Developer settings.
- Open OAuth Apps.
- Choose New OAuth App.
- Fill in the app name and homepage URL.
- Set Authorization callback URL to the exact OpenConnector callback URL.
- Register the app.
GitHub’s official guide is Creating an OAuth app. GitHub OAuth apps have one authorization callback URL, so create separate apps for local, staging, and production if each environment has a different callback URL.
Step 3: Copy the client credentials
From the GitHub OAuth app page, copy:
| GitHub value | OpenConnector field |
|---|---|
| Client ID | clientId |
| Client secret | clientSecret |
Step 4: Save the GitHub client in OpenConnector
Use the OpenConnector web console:
- Open the OpenConnector web console, such as
http://localhost:3000. - Open Providers and select GitHub.
- Choose Configure OAuth Client or Edit OAuth Client.
- Paste the GitHub client ID and client secret.
- Choose Save OAuth Client.
Step 5: Connect and test
After saving the OAuth client, choose Connect on the GitHub provider page. Approve the GitHub OAuth app, return to OpenConnector, and confirm that the provider page shows the account as connected.
Use github.get_current_user as a low-risk test action from the console action list.
Troubleshooting
| Symptom | What to check |
|---|---|
| Redirect URI mismatch | GitHub’s authorization callback URL must exactly match <openconnector-origin>/oauth/callback. |
| The wrong account authorized the app | Sign out of GitHub or use a clean browser profile before starting authorization. |
| Repo actions fail | The connection may not have repo scope or the user may not have access to the target repository. |
| Workflow actions fail | The connection may not have workflow scope. Reconnect after adjusting requested scopes. |
| Delete actions fail | Avoid delete_repo unless you intentionally need destructive repository actions. |