A client-side endpoint (which can only be queried from the user's browser) that starts the GitHub OAuth flow. This endpoint generates the GitHub OAuth URL with all required fields and redirects the user to that URL. The user authenticates with GitHub before getting redirected back to Stytch. After verifying the request, Stytch redirects the user back to the login_redirect_url or signup_redirect_url URL provided.
One of organization_id or slug is required to specify which organization the user is trying to access. If the organization that the user is trying to access is not yet known, use the GitHub OAuth Discovery endpoint instead.
Scopes
By default, our GitHub OAuth integration requests the user and read:org scopes. You may add any additional GitHub API scopes (see here for a complete list) as a space separated list in the custom_scopes query parameter.
Additional provider parameters
Any parameters that should be forwarded to the OAuth provider can be passed as query parameters with the provider_ prefix. For example, some OAuth providers support a login_hint parameter that allows you to pre-populate the OAuth login flow with a suggested email address. To specify the login_hint parameter in your OAuth request, you'd include provider_login_hint=exampleHint as a query parameter. We recommend consulting each OAuth provider's documentation for a list of supported parameters.
Next steps
Once the user successfully authenticates with GitHub, they'll be redirected to the redirect URL that you provided at the start of the OAuth flow with a Stytch OAuth token. Collect the token from the URL query parameters, and call Authenticate OAuth Token to complete authentication. The OAuth 2.0 Access Token and ID token will also be made available via the Get GitHub Access Token endpoint.