{"id":25216258,"url":"https://github.com/art2url/git-oauth-bridge","last_synced_at":"2025-07-04T10:04:23.053Z","repository":{"id":276519416,"uuid":"929518147","full_name":"art2url/git-oauth-bridge","owner":"art2url","description":"🗄️ A lightweight Node.js + Express server that handles GitHub OAuth authentication, exchanges authorization codes for access tokens, and retrieves user information. Perfect for integrating GitHub login into your apps.","archived":false,"fork":false,"pushed_at":"2025-02-08T19:40:24.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T09:14:58.418Z","etag":null,"topics":["authentification","authorization-server","axios","backend","cors","dotenv","express-js","expressjs","github-api","github-oauth","node","node-js","oauth2","rest-api","secure-authentication"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/art2url.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-08T18:22:26.000Z","updated_at":"2025-02-10T10:37:29.000Z","dependencies_parsed_at":"2025-02-08T19:30:10.051Z","dependency_job_id":null,"html_url":"https://github.com/art2url/git-oauth-bridge","commit_stats":null,"previous_names":["art2url/git-oauth-bridge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/art2url/git-oauth-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fgit-oauth-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fgit-oauth-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fgit-oauth-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fgit-oauth-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art2url","download_url":"https://codeload.github.com/art2url/git-oauth-bridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art2url%2Fgit-oauth-bridge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263489675,"owners_count":23474526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentification","authorization-server","axios","backend","cors","dotenv","express-js","expressjs","github-api","github-oauth","node","node-js","oauth2","rest-api","secure-authentication"],"created_at":"2025-02-10T19:17:29.752Z","updated_at":"2025-07-04T10:04:23.019Z","avatar_url":"https://github.com/art2url.png","language":"JavaScript","readme":"\n# GitHub OAuth Server\n\nThis repository provides a simple Node.js + Express backend that handles GitHub OAuth authentication. It exchanges the GitHub authorization code for an access token and retrieves user information.\n\n## Features\n- Handles GitHub OAuth authentication\n- Exchanges authorization code for access token\n- Retrieves authenticated GitHub user's information\n- Configurable via environment variables\n- CORS-enabled for integration with front-end applications\n\n## Prerequisites\n- Node.js and npm installed on your machine\n- A GitHub OAuth application with Client ID and Client Secret\n\n## Setup\n\n1. **Clone the Repository:**\n```bash\ngit clone https://github.com/art2url/git-oauth-bridge.git\ncd git-oauth-bridge\n```\n\n2. **Install Dependencies:**\n```bash\nnpm install\n```\n\n3. **Retrieve GitHub OAuth Credentials:**\n   - Go to [GitHub Developer Settings](https://github.com/settings/developers).\n   - Click on **\"New OAuth App\"**.\n   - Fill in the required fields:\n     - **Application Name:** Your app's name.\n     - **Homepage URL:** Your app's homepage (e.g., `http://localhost:3000`).\n     - **Authorization Callback URL:** `http://localhost:3000/auth/github/callback` (or your actual callback URL).\n   - After creating the app, you will see **Client ID** and **Client Secret**.\n\n4. **Configure Environment Variables:**\nCreate a `.env` file in the root directory with the following content:\n```env\nGITHUB_CLIENT_ID=your_github_client_id\nGITHUB_CLIENT_SECRET=your_github_client_secret\nPORT=3000 # Optional, defaults to 3000\n```\n\n5. **Run the Server:**\n```bash\nnode server.js\n```\n\n## API Endpoints\n\n### POST `/auth/github`\nHandles GitHub OAuth authentication by exchanging the authorization code for an access token and retrieving user information.\n\n#### Request Body:\n```json\n{\n  \"code\": \"\u003cgithub_authorization_code\u003e\"\n}\n```\n\n#### Successful Response:\n```json\n{\n  \"access_token\": \"\u003cgithub_access_token\u003e\",\n  \"github_username\": \"\u003cgithub_username\u003e\"\n}\n```\n\n#### Error Responses:\n- **400 Bad Request:** If the authorization code is missing or invalid.\n- **500 Internal Server Error:** If there's an issue during the OAuth flow.\n\n## License\nThis project is licensed under the MIT License.\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart2url%2Fgit-oauth-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart2url%2Fgit-oauth-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart2url%2Fgit-oauth-bridge/lists"}