Github register a new oauth application
Here's a step-by-step guide on how to register a new OAuth application on GitHub:
Step 1: Go to the GitHub Developer Settings
- Log in to your GitHub account.
- Click on your profile picture in the top right corner, then select "Settings" from the dropdown menu.
- Click on "Developer settings" from the left-hand menu.
Step 2: Click on "New OAuth App"
- Click on the "New OAuth App" button.
Step 3: Fill in the Application Information
- Fill in the required information for your application:
- Application name: Give your application a name (e.g., "My GitHub App").
- Authorization callback URL: Enter the URL that GitHub will redirect users to after authorization (e.g.,
http://example.com/callback
). - Application description: Provide a brief description of your application.
- Click "Register application" to create the application.
Step 4: Generate a Client ID and Client Secret
- GitHub will generate a Client ID and Client Secret for your application.
- Make a note of these values, as you'll need them to authenticate with GitHub.
Step 5: Configure the OAuth Scopes
- Under "OAuth applications", click on the "Edit" button next to your application.
- Scroll down to the "OAuth scopes" section.
- Select the scopes you want to request from users (e.g.,
repo
,read:org
,write:public_repo
). - Click "Update" to save your changes.
Step 6: Use the Client ID and Client Secret
- Use the Client ID and Client Secret to authenticate with GitHub and request access tokens.
- You can use the
Authorization
header with theBearer
scheme to authenticate with GitHub, like this:Authorization: Bearer YOUR_CLIENT_ID
.
That's it! You've successfully registered a new OAuth application on GitHub.