GET /api/auth/github
Summary
Initiates the GitHub OAuth authorization flow by redirecting the client to GitHub’s OAuth consent page.
Intent
This endpoint exists to begin the GitHub OAuth 2.0 authentication process, redirecting users to GitHub so they can grant the application access to their profile, email, and organization membership.
Parameters
No parameters.
Request example
curl -v -L -H "Authorization: Bearer YOUR_API_TOKEN" "https://maps.google.com/api/auth/github"Response example
{ "location": "https://github.com/login/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=read%3Auser+user%3Aemail+read%3Aorg"}Error cases
302— Always returns a redirect — no 200 response is issued directly by this endpoint500— Server misconfiguration — clientId or redirectUri options are missing or invalid on the server side
Gotchas
- This endpoint always responds with an HTTP 302 redirect to GitHub — do not expect a JSON body from this endpoint itself.
- The OAuth scopes requested are fixed at ‘read:user user:email read:org’ and cannot be changed by the caller.
- The client_id and redirect_uri are configured server-side via opts; callers have no control over these values.
- Following the redirect will take the user to GitHub’s consent page; your HTTP client must support redirect following to complete the flow.
- After the user authorizes on GitHub, GitHub will redirect back to the configured redirect_uri — ensure that URI is registered in your GitHub OAuth App settings.
- Although an Authorization header is listed, this endpoint does not enforce authentication (auth required: false), so the header may not be validated.