> ## 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.

# Initiate custom OAuth flow (PKCE)

> Generate OAuth authorization URL for a configured custom OAuth provider using PKCE flow



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/auth.yaml get /api/auth/oauth/custom/{key}
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/custom/{key}:
    get:
      tags:
        - Client
      summary: Initiate custom OAuth flow (PKCE)
      description: >-
        Generate OAuth authorization URL for a configured custom OAuth provider
        using PKCE flow
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
        - name: redirect_uri
          in: query
          required: true
          schema:
            type: string
            format: uri
          description: >-
            URL to redirect after authentication (receives insforge_code
            parameter)
        - name: code_challenge
          in: query
          required: false
          schema:
            type: string
          description: PKCE code challenge for mobile/desktop/server clients
      responses:
        '200':
          description: OAuth authorization URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  authUrl:
                    type: string
                    format: uri
        '400':
          description: Invalid request
        '404':
          description: Custom OAuth provider not found

````