curl --request POST \
--url https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "client_a3f8b2...",
"user_id": "user_42",
"user_hash": "4f1d8a..."
}
'import requests
url = "https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth"
payload = {
"client_id": "client_a3f8b2...",
"user_id": "user_42",
"user_hash": "4f1d8a..."
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({client_id: 'client_a3f8b2...', user_id: 'user_42', user_hash: '4f1d8a...'})
};
fetch('https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth', 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://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'client_a3f8b2...',
'user_id' => 'user_42',
'user_hash' => '4f1d8a...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth"
payload := strings.NewReader("{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}"
response = http.request(request)
puts response.read_body{
"jwt": "eyJhbGciOiJIUzI1...",
"expires_in": 900,
"supabase_url": "https://yghpblhxrfmxkwejvpjz.supabase.co",
"supabase_anon_key": "eyJhbGciO..."
}Autenticar widget In-App
Troca o client_id público do OAuth Client + o user_id do usuário (e o user_hash, quando houver) por um token de 15 minutos, que só lê e marca como lidas as notificações in-app daquele usuário. O widget oficial chama este endpoint sozinho; use-o só se construir uma interface própria. Verificação de identidade: user_hash = HMAC-SHA256 do user_id com o segredo de verificação da conta, em hexadecimal, calculado no seu servidor. Só usuários MASTER da conta veem e geram o segredo e ligam a exigência, em Configurações → Canais → In-app (dentro da aplicação). Um user_hash enviado é sempre conferido; sem ele, a chamada só é aceita se a conta não exige a verificação. Limite: 60 chamadas por minuto por IP.
curl --request POST \
--url https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "client_a3f8b2...",
"user_id": "user_42",
"user_hash": "4f1d8a..."
}
'import requests
url = "https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth"
payload = {
"client_id": "client_a3f8b2...",
"user_id": "user_42",
"user_hash": "4f1d8a..."
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({client_id: 'client_a3f8b2...', user_id: 'user_42', user_hash: '4f1d8a...'})
};
fetch('https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth', 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://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'client_a3f8b2...',
'user_id' => 'user_42',
'user_hash' => '4f1d8a...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth"
payload := strings.NewReader("{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://yghpblhxrfmxkwejvpjz.supabase.co/functions/v1/in-app-auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"client_a3f8b2...\",\n \"user_id\": \"user_42\",\n \"user_hash\": \"4f1d8a...\"\n}"
response = http.request(request)
puts response.read_body{
"jwt": "eyJhbGciOiJIUzI1...",
"expires_in": 900,
"supabase_url": "https://yghpblhxrfmxkwejvpjz.supabase.co",
"supabase_anon_key": "eyJhbGciO..."
}Body
client_id público do OAuth Client. Os nomes key e api_token também são aceitos para o mesmo valor
"client_a3f8b2..."
Identificador do usuário no seu sistema. Com user_hash, é usado exatamente como enviado
"user_42"
HMAC-SHA256 do user_id com o segredo de verificação de identidade da conta, em hexadecimal, calculado no seu servidor. Obrigatório quando a conta liga Exigir verificação de identidade; quando enviado, é sempre conferido
"4f1d8a..."