---
title: "Initiate OAuth flow (PKCE)"
method: GET
path: "/api/auth/oauth/{provider}"
tags: ["Client"]
---

# Initiate OAuth flow (PKCE)

`GET /api/auth/oauth/{provider}`

Generate OAuth authorization URL for any supported provider using PKCE flow.

For mobile/desktop/server clients using PKCE:
1. Generate code_verifier (random string, 43-128 chars)
2. Generate code_challenge = Base64URL(SHA256(code_verifier))
3. Call this endpoint with code_challenge
4. After OAuth callback, use /api/auth/oauth/exchange with code_verifier

## Path parameters

- `provider` 'google' | 'github' | 'discord' | 'linkedin' | 'facebook' | 'instagram' | 'tiktok' | 'apple' | 'x' | 'spotify' | 'microsoft', required

## Query parameters

- `redirect_uri` string, uri, required
- `code_challenge` string

## Response `200`

OAuth authorization URL

- object
  - `authUrl` string, uri — URL to redirect user for OAuth provider login

## Other responses

- `400` — Invalid request or provider not supported
- `500` — OAuth not configured

---

[API](https://skmtc.net/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.net/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/versions/a935bb49f932/schema)
