Gerar token de acesso JWT
curl --request POST \
--url https://api.public.firebanking.com.br/api/auth/token \
--header 'Content-Type: application/json' \
--header 'X-SSL-Client-Cert: <x-ssl-client-cert>' \
--data '
{
"clientId": "account-93-550e8400",
"clientSecret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
'import requests
url = "https://api.public.firebanking.com.br/api/auth/token"
payload = {
"clientId": "account-93-550e8400",
"clientSecret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
headers = {
"X-SSL-Client-Cert": "<x-ssl-client-cert>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SSL-Client-Cert': '<x-ssl-client-cert>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'account-93-550e8400',
clientSecret: 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
})
};
fetch('https://api.public.firebanking.com.br/api/auth/token', 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.public.firebanking.com.br/api/auth/token",
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([
'clientId' => 'account-93-550e8400',
'clientSecret' => 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SSL-Client-Cert: <x-ssl-client-cert>"
],
]);
$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.public.firebanking.com.br/api/auth/token"
payload := strings.NewReader("{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SSL-Client-Cert", "<x-ssl-client-cert>")
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.public.firebanking.com.br/api/auth/token")
.header("X-SSL-Client-Cert", "<x-ssl-client-cert>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.public.firebanking.com.br/api/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SSL-Client-Cert"] = '<x-ssl-client-cert>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 1800
}Autenticação
Gerar token de acesso JWT
Requer certificado de cliente no header X-SSL-Client-Cert. Autentique usando certificado de cliente X.509 + credenciais OAuth 2.0 (clientId/clientSecret) e receba um token JWT.
POST
/
api
/
auth
/
token
Gerar token de acesso JWT
curl --request POST \
--url https://api.public.firebanking.com.br/api/auth/token \
--header 'Content-Type: application/json' \
--header 'X-SSL-Client-Cert: <x-ssl-client-cert>' \
--data '
{
"clientId": "account-93-550e8400",
"clientSecret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
'import requests
url = "https://api.public.firebanking.com.br/api/auth/token"
payload = {
"clientId": "account-93-550e8400",
"clientSecret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
headers = {
"X-SSL-Client-Cert": "<x-ssl-client-cert>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SSL-Client-Cert': '<x-ssl-client-cert>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'account-93-550e8400',
clientSecret: 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
})
};
fetch('https://api.public.firebanking.com.br/api/auth/token', 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.public.firebanking.com.br/api/auth/token",
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([
'clientId' => 'account-93-550e8400',
'clientSecret' => 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SSL-Client-Cert: <x-ssl-client-cert>"
],
]);
$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.public.firebanking.com.br/api/auth/token"
payload := strings.NewReader("{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SSL-Client-Cert", "<x-ssl-client-cert>")
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.public.firebanking.com.br/api/auth/token")
.header("X-SSL-Client-Cert", "<x-ssl-client-cert>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.public.firebanking.com.br/api/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SSL-Client-Cert"] = '<x-ssl-client-cert>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"account-93-550e8400\",\n \"clientSecret\": \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 1800
}Este endpoint gera um token JWT de acesso válido por 30 minutos (1800 segundos). Requer certificado X.509 vinculado à conta e credenciais OAuth 2.0.
O certificado X.509 deve ser enviado URL-encoded no header
X-SSL-Client-Cert. O certificado deve estar previamente vinculado à sua conta.Cabeçalhos
Certificado PEM do cliente codificado em URL (header padrão do NGINX)
Exemplo:
"-----BEGIN%20CERTIFICATE-----%0AMIIBkTCB..."
Corpo
application/json