> ## Documentation Index
> Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Provider-specific OAuth callback (GET)

> OAuth callback endpoint for provider-specific flows (most providers use GET).

Response varies based on the original OAuth initiation:
- With code_challenge (PKCE): Redirects with `insforge_code` for exchange endpoint
- Without code_challenge (web): Redirects with `access_token` and sets httpOnly cookie




## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/auth.yaml get /api/auth/oauth/{provider}/callback
openapi: 3.0.3
info:
  title: Insforge Authentication API
  version: 2.0.0
  description: Authentication endpoints with separated auth and profile tables
servers: []
security: []
paths:
  /api/auth/oauth/{provider}/callback:
    get:
      tags:
        - Client
      summary: Provider-specific OAuth callback (GET)
      description: >
        OAuth callback endpoint for provider-specific flows (most providers use
        GET).


        Response varies based on the original OAuth initiation:

        - With code_challenge (PKCE): Redirects with `insforge_code` for
        exchange endpoint

        - Without code_challenge (web): Redirects with `access_token` and sets
        httpOnly cookie
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
            enum:
              - google
              - github
              - discord
              - linkedin
              - facebook
              - instagram
              - tiktok
              - apple
              - x
              - spotify
              - microsoft
        - name: code
          in: query
          schema:
            type: string
          description: Authorization code from OAuth provider
        - name: state
          in: query
          required: true
          schema:
            type: string
          description: JWT state with redirect URI and optional code_challenge
        - name: token
          in: query
          schema:
            type: string
          description: Direct ID token (for some providers)
      responses:
        '302':
          description: >
            Redirect to application.

            - PKCE flow:
            redirect_uri?insforge_code={code}&user_id={id}&email={email}&name={name}

            - Web flow:
            redirect_uri?access_token={token}&user_id={id}&email={email}&name={name}&csrf_token={csrf}
          headers:
            Location:
              schema:
                type: string
                format: uri
                description: Redirect URL with authentication parameters

````