Skip to main content
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your API key. Must only be used when using Hanko Cloud.

Path Parameters

id
string<uuid>
required

UUID of the requested object

credential_id
string
required

Response

OK

id
string<uuid4>
required

The ID of the credential

Example:

"f9bebc04-b894-4018-bdb8-8b520a532fef"

public_key
string
required

The public key of the credential

attestation_type
string
required

The attestation type the credential was registered with

aaguid
string
required

The AAGUID of the authenticator the credentials was created on

created_at
string<date-time>
required

Time of creation of the credential

backup_eligible
boolean
required

Indicates if the credential can be backed up

backup_state
boolean
required

Indicates if the credential is backed up

mfa_only
boolean
required

Indicates if the credential can only be used as a MFA credential

name
string

A name that the user choose

transports
string[]

The ways the authenticator is connected

last_used_at
string<date-time>

The time when the credential was last used