Get a WebAuthn credential of a user
curl --request GET \
--url https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}', 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://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "f9bebc04-b894-4018-bdb8-8b520a532fef",
"public_key": "<string>",
"attestation_type": "<string>",
"aaguid": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"backup_eligible": true,
"backup_state": true,
"mfa_only": true,
"name": "<string>",
"transports": [
"<string>"
],
"last_used_at": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request"
}{
"code": 404,
"message": "Not found"
}{
"code": 500,
"message": "Internal Server Error"
}WebAuthn credential Management
Get a WebAuthn credential of a user
GET
/
users
/
{id}
/
webauthn_credentials
/
{credential_id}
Get a WebAuthn credential of a user
curl --request GET \
--url https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}', 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://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_id}.hanko.io/admin/users/{id}/webauthn_credentials/{credential_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "f9bebc04-b894-4018-bdb8-8b520a532fef",
"public_key": "<string>",
"attestation_type": "<string>",
"aaguid": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"backup_eligible": true,
"backup_state": true,
"mfa_only": true,
"name": "<string>",
"transports": [
"<string>"
],
"last_used_at": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request"
}{
"code": 404,
"message": "Not found"
}{
"code": 500,
"message": "Internal Server Error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your API key. Must only be used when using Hanko Cloud.
Response
OK
The ID of the credential
Example:
"f9bebc04-b894-4018-bdb8-8b520a532fef"
The public key of the credential
The attestation type the credential was registered with
The AAGUID of the authenticator the credentials was created on
Time of creation of the credential
Indicates if the credential can be backed up
Indicates if the credential is backed up
Indicates if the credential can only be used as a MFA credential
A name that the user choose
The ways the authenticator is connected
The time when the credential was last used
Was this page helpful?