Get RSA public key for JWT verification
curl --request GET \
--url https://{defaultHost}/v1/auth/{app_id}/public_keyimport requests
url = "https://{defaultHost}/v1/auth/{app_id}/public_key"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{defaultHost}/v1/auth/{app_id}/public_key', 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://{defaultHost}/v1/auth/{app_id}/public_key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/auth/{app_id}/public_key"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/auth/{app_id}/public_key")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/auth/{app_id}/public_key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI...",
"key_id": "ws_123_1640995200",
"algorithm": "RS256",
"workspace_id": "ws_123",
"generated_at": "2024-01-01T12:00:00Z"
}{
"error": "App not found",
"error_code": "app_not_found"
}{
"error": "RSA keys not available",
"error_code": "keys_not_available"
}RSA Keys
Get RSA public key for JWT verification
Returns the RSA public key for JWT token verification. This endpoint is PUBLIC and requires no authentication.
Why this endpoint is public:
- Required for JWT verification by client applications
- Follows OAuth2/OIDC standards where JWKS endpoints are public
- Avoids chicken-and-egg problem (clients need keys to verify tokens)
- Only exposes public keys, no sensitive data
The endpoint delegates to the app’s workspace key infrastructure.
GET
/
v1
/
auth
/
{app_id}
/
public_key
Get RSA public key for JWT verification
curl --request GET \
--url https://{defaultHost}/v1/auth/{app_id}/public_keyimport requests
url = "https://{defaultHost}/v1/auth/{app_id}/public_key"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{defaultHost}/v1/auth/{app_id}/public_key', 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://{defaultHost}/v1/auth/{app_id}/public_key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/auth/{app_id}/public_key"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/auth/{app_id}/public_key")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/auth/{app_id}/public_key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI...",
"key_id": "ws_123_1640995200",
"algorithm": "RS256",
"workspace_id": "ws_123",
"generated_at": "2024-01-01T12:00:00Z"
}{
"error": "App not found",
"error_code": "app_not_found"
}{
"error": "RSA keys not available",
"error_code": "keys_not_available"
}Path Parameters
App ID
Response
successful
PEM-formatted RSA public key for JWT verification
Example:
"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI..."
Unique key identifier for JWT verification (kid header)
Example:
"ws_123_1640995200"
JWT signing algorithm used by this key
Example:
"RS256"
Workspace ID that owns this key
Example:
"ws_123"
When the key was generated
Example:
"2024-01-01T12:00:00Z"
Was this page helpful?