Get authenticated caller
curl --request GET \
--url https://api.endaoment.org/v1/auth/whoami \
--cookie NdaoAuth=import requests
url = "https://api.endaoment.org/v1/auth/whoami"
headers = {"cookie": "NdaoAuth="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'NdaoAuth='}};
fetch('https://api.endaoment.org/v1/auth/whoami', 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.endaoment.org/v1/auth/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "NdaoAuth=",
]);
$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://api.endaoment.org/v1/auth/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "NdaoAuth=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.endaoment.org/v1/auth/whoami")
.header("cookie", "NdaoAuth=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endaoment.org/v1/auth/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'NdaoAuth='
response = http.request(request)
puts response.read_body{
"clientName": "Authorization Server",
"roles": [
"keeper"
],
"openIdConnectClientId": "partner-oidc-client"
}Authentication
Get authenticated caller
Returns information about the caller authenticated through one of the supported API auth mechanisms. API key callers receive API client metadata. Human callers receive their JWT payload from either the Endaoment browser session cookie or an OIDC bearer token. Browser sessions may receive a new Set-Cookie header when referral-source metadata was missing from the JWT. That replacement keeps the original exp. This route does not extend the session.
GET
/
v1
/
auth
/
whoami
Get authenticated caller
curl --request GET \
--url https://api.endaoment.org/v1/auth/whoami \
--cookie NdaoAuth=import requests
url = "https://api.endaoment.org/v1/auth/whoami"
headers = {"cookie": "NdaoAuth="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'NdaoAuth='}};
fetch('https://api.endaoment.org/v1/auth/whoami', 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.endaoment.org/v1/auth/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "NdaoAuth=",
]);
$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://api.endaoment.org/v1/auth/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "NdaoAuth=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.endaoment.org/v1/auth/whoami")
.header("cookie", "NdaoAuth=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endaoment.org/v1/auth/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'NdaoAuth='
response = http.request(request)
puts response.read_body{
"clientName": "Authorization Server",
"roles": [
"keeper"
],
"openIdConnectClientId": "partner-oidc-client"
}Headers
Response
Authenticated caller metadata
- Option 1
- Option 2
- Option 3
Was this page helpful?