Login via Google OAuth
curl --request POST \
--url https://api.engineapi.com.br/v1/auth/google \
--header 'Content-Type: application/json' \
--data '
{
"idToken": "<string>"
}
'import requests
url = "https://api.engineapi.com.br/v1/auth/google"
payload = { "idToken": "<string>" }
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({idToken: '<string>'})
};
fetch('https://api.engineapi.com.br/v1/auth/google', 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.engineapi.com.br/v1/auth/google",
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([
'idToken' => '<string>'
]),
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://api.engineapi.com.br/v1/auth/google"
payload := strings.NewReader("{\n \"idToken\": \"<string>\"\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://api.engineapi.com.br/v1/auth/google")
.header("Content-Type", "application/json")
.body("{\n \"idToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engineapi.com.br/v1/auth/google")
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 \"idToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"partnerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Autenticação
Login via Google OAuth
Autentica um parceiro via Google OAuth SSO.
Recebe o ID token emitido pelo Google e o verifica server-side
(assinatura + audience GOOGLE_CLIENT_ID + email_verified) antes de emitir o JWT.
O e-mail verificado é associado a um User já cadastrado no banco.
Se o e-mail não existir, retorna 404: o frontend redireciona para a página de cadastro
com o e-mail pré-preenchido.
Token inválido/expirado, audience errada ou GOOGLE_CLIENT_ID ausente no servidor: 401.
POST
/
v1
/
auth
/
google
Login via Google OAuth
curl --request POST \
--url https://api.engineapi.com.br/v1/auth/google \
--header 'Content-Type: application/json' \
--data '
{
"idToken": "<string>"
}
'import requests
url = "https://api.engineapi.com.br/v1/auth/google"
payload = { "idToken": "<string>" }
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({idToken: '<string>'})
};
fetch('https://api.engineapi.com.br/v1/auth/google', 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.engineapi.com.br/v1/auth/google",
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([
'idToken' => '<string>'
]),
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://api.engineapi.com.br/v1/auth/google"
payload := strings.NewReader("{\n \"idToken\": \"<string>\"\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://api.engineapi.com.br/v1/auth/google")
.header("Content-Type", "application/json")
.body("{\n \"idToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engineapi.com.br/v1/auth/google")
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 \"idToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"partnerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}⌘I