Get authenticated caller
curl --request GET \
--url https://api.dev.endaoment.org/v1/auth/whoami \
--cookie NdaoAuth=import requests
url = "https://api.dev.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.dev.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.dev.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.dev.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.dev.endaoment.org/v1/auth/whoami")
.header("cookie", "NdaoAuth=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.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 refreshed Set-Cookie header when referral-source metadata is updated.
GET
/
v1
/
auth
/
whoami
Get authenticated caller
curl --request GET \
--url https://api.dev.endaoment.org/v1/auth/whoami \
--cookie NdaoAuth=import requests
url = "https://api.dev.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.dev.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.dev.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.dev.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.dev.endaoment.org/v1/auth/whoami")
.header("cookie", "NdaoAuth=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.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"
}Authorizations
NdaoAuthCookieApiKeybearer
Headers
API key used by server-side integrations. Bearer auth or the NdaoAuth cookie may also be used.
Response
Authenticated caller metadata
- Option 1
- Option 2
- Option 3
Human-readable name of the API key client.
Example:
"Authorization Server"
Roles granted to the API key client.
Example:
["keeper"]
OIDC client ID associated with the API key, when the key is tied to a tech platform.
Example:
"partner-oidc-client"
Was this page helpful?