curl -X POST https://my_sql_node.com/v1/sso_token \
-H "Content-Type: application/json" \
-d '{
"id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"database": "retail_analytics"
}'import requests
url = "https://{sql_node}/v1/sso_token"
payload = {
"database": "<string>",
"id_token": "<string>",
"access_token ": "<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({database: '<string>', id_token: '<string>', 'access_token ': '<string>'})
};
fetch('https://{sql_node}/v1/sso_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://{sql_node}/v1/sso_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([
'database' => '<string>',
'id_token' => '<string>',
'access_token\t' => '<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://{sql_node}/v1/sso_token"
payload := strings.NewReader("{\n \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<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://{sql_node}/v1/sso_token")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/sso_token")
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 \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"database": "retail_analytics"
}sso_token
Exchange an OpenID Connect identifier token or access token for an Ocient access token. This endpoint allows clients to directly exchange tokens without following the full browser-based authentication process. This exchange is useful for server-to-server scenarios or when the client already has a valid OpenID token from another process.
curl -X POST https://my_sql_node.com/v1/sso_token \
-H "Content-Type: application/json" \
-d '{
"id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"database": "retail_analytics"
}'import requests
url = "https://{sql_node}/v1/sso_token"
payload = {
"database": "<string>",
"id_token": "<string>",
"access_token ": "<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({database: '<string>', id_token: '<string>', 'access_token ': '<string>'})
};
fetch('https://{sql_node}/v1/sso_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://{sql_node}/v1/sso_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([
'database' => '<string>',
'id_token' => '<string>',
'access_token\t' => '<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://{sql_node}/v1/sso_token"
payload := strings.NewReader("{\n \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<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://{sql_node}/v1/sso_token")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/sso_token")
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 \"database\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\\t\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"database": "retail_analytics"
}Body
Target database for connection after successful authentication. This database must be accessible to the user identified by the SSO token.
OpenID identifier token received from the OpenID provider after successful authentication. You must provide the id_token or access_token body parameters, but not both.
OpenID access token received from the OpenID provider after successful authentication. You must provide the id_token or access_token body parameters, but not both.
Was this page helpful?

