This server handles the OAuth authentication flow for the SolveSync Chrome extension, enabling secure GitHub authorization and token management.
- Secure OAuth authentication with GitHub.
- Exchanges authorization codes for access tokens.
- Retrieves GitHub user information using access tokens.
- Cross-Origin Resource Sharing (CORS) enabled for broad compatibility.
- Node.js (v12 or higher)
- npm or yarn
- A GitHub OAuth App with the following details:
- Client ID and Client Secret
-
Clone the Repository:
git clone https://github.com/art2url/solve-sync-oauth-server.git cd solve-sync-oauth-server
-
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.env
file in the root directory:GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret PORT=3000 # Optional: Defaults to 3000 if not set
-
Run the Server:
npm start
The server will run at
http://localhost:3000
.
Exchanges the GitHub OAuth code for an access token and retrieves the GitHub username.
Request:
{
"code": "authorization_code_from_github"
}
Response:
{
"access_token": "github_access_token",
"github_username": "your_github_username"
}
This project is licensed under the MIT License.
Contributions are welcome! Feel free to open an issue or submit a pull request.
SolveSync β Automate your coding workflow with secure GitHub integration! π