Provider-specific OAuth callback (GET)
curl --request GET \
--url https://api.example.com/api/auth/oauth/{provider}/callbackimport requests
url = "https://api.example.com/api/auth/oauth/{provider}/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/auth/oauth/{provider}/callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/oauth/{provider}/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/oauth/{provider}/callback"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/auth/oauth/{provider}/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/oauth/{provider}/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyClient
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_codefor exchange endpoint - Without code_challenge (web): Redirects with
access_tokenand sets httpOnly cookie
GET
/
api
/
auth
/
oauth
/
{provider}
/
callback
Provider-specific OAuth callback (GET)
curl --request GET \
--url https://api.example.com/api/auth/oauth/{provider}/callbackimport requests
url = "https://api.example.com/api/auth/oauth/{provider}/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/auth/oauth/{provider}/callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/oauth/{provider}/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/oauth/{provider}/callback"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/auth/oauth/{provider}/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/oauth/{provider}/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyPath Parameters
Available options:
google, github, discord, linkedin, facebook, instagram, tiktok, apple, x, spotify, microsoft Query Parameters
Authorization code from OAuth provider
JWT state with redirect URI and optional code_challenge
Direct ID token (for some providers)
Response
302
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}
Was this page helpful?