curl --request POST \
--url https://vitalog-api.example.com/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'code=<string>' \
--data 'redirect_uri=<string>' \
--data 'resource=<string>' \
--data 'code_verifier=<string>' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data 'client_assertion=<string>' \
--data client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearerimport requests
url = "https://vitalog-api.example.com/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "<string>",
"resource": "<string>",
"code_verifier": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"client_assertion": "<string>",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: '<string>',
resource: '<string>',
code_verifier: '<string>',
client_id: '<string>',
client_secret: '<string>',
client_assertion: '<string>',
client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
})
};
fetch('https://vitalog-api.example.com/oauth/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://vitalog-api.example.com/oauth/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 => "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://vitalog-api.example.com/oauth/token"
payload := strings.NewReader("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vitalog-api.example.com/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitalog-api.example.com/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer"
response = http.request(request)
puts response.read_body{
"token_type": "Bearer",
"expires_in": 1296000,
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}OAuth exchange code
Authorization-code exchange with S256 PKCE and exact client, consented callback and canonical MCP resource binding. Public clients use client_id without a secret; confidential clients use their declared client_secret_basic, client_secret_post or private_key_jwt method. JWT clients send a signed assertion with registered public keys and a unique jti; replay is blocked across restarts. Basic credentials or a verified assertion identify the client when client_id is omitted from the body. Unknown OAuth parameters are ignored. No refresh or client-credentials grants. Atomically consumes the code and creates a scoped 30-day MCP token and its API-key management record. The primary AUTH_KEY can list or revoke this record. Revocation is checked on every MCP request.
curl --request POST \
--url https://vitalog-api.example.com/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'code=<string>' \
--data 'redirect_uri=<string>' \
--data 'resource=<string>' \
--data 'code_verifier=<string>' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data 'client_assertion=<string>' \
--data client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearerimport requests
url = "https://vitalog-api.example.com/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "<string>",
"resource": "<string>",
"code_verifier": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"client_assertion": "<string>",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: '<string>',
resource: '<string>',
code_verifier: '<string>',
client_id: '<string>',
client_secret: '<string>',
client_assertion: '<string>',
client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
})
};
fetch('https://vitalog-api.example.com/oauth/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://vitalog-api.example.com/oauth/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 => "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://vitalog-api.example.com/oauth/token"
payload := strings.NewReader("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vitalog-api.example.com/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitalog-api.example.com/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=%3Cstring%3E&resource=%3Cstring%3E&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E&client_assertion=%3Cstring%3E&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer"
response = http.request(request)
puts response.read_body{
"token_type": "Bearer",
"expires_in": 1296000,
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Body
"authorization_code"^voc_[A-Za-z0-9_-]{43}$1 - 512^[^\s\u0000-\u001f\u007f]+$512^[A-Za-z0-9._~-]{43,128}$1 - 512^[^\s\u0000-\u001f\u007f]+$1 - 5121 - 3072"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"Was this page helpful?
