Skip to main content

List WebAuthn Credentials

List all registered WebAuthn credentials for the authenticated user.

Quick Navigation

Endpoint

GET /api/v1/webauthn/credentials

Headers

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Response

Success (200)

{
"success": true,
"data": {
"credentials": [
{
"id": 1,
"device_name": "iPhone 14 Pro",
"credential_id": "credential_id_base64",
"created_at": "2024-01-01T10:00:00Z",
"last_used_at": "2024-01-01T14:00:00Z",
"usage_count": 15
},
{
"id": 2,
"device_name": "YubiKey 5",
"credential_id": "credential_id_base64",
"created_at": "2024-01-02T10:00:00Z",
"last_used_at": "2024-01-02T11:00:00Z",
"usage_count": 3
}
],
"total_count": 2
},
"message": "WebAuthn credentials retrieved successfully"
}

Error Codes

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing token
500CREDENTIAL_LISTING_FAILEDInternal server error

Data Flow

  1. Authentication

    • Verify access token
    • Get current user
  2. Credentials Query

    • Query WebAuthnCredential table
    • Filter by user ID
    • Order by created_at DESC
  3. Data Formatting

    • Format credential details
    • Include usage statistics
    • Include timestamps
  4. Response

    • Return credentials list
    • Return total count

Features

  • List all registered credentials
  • Show usage statistics
  • Display credential names
  • Include creation and last used dates
  • Safe credential ID display

Example

curl -X GET https://api.rivergen.com/api/v1/webauthn/credentials \
-H "Authorization: Bearer <access_token>"