Passkey Reference | PropelAuth BYO Documentation

Passkey Reference

Start Passkey Registration

Initiates the passkey registration process for a user. This generates WebAuthn registration options that should be passed to your WebAuthn library on the client side.

Arguments

Successful Response

Error Types

Example request in different programming languages:

const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.startRegistration({
  userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492",
  emailOrUsername: "user@example.com",
  userDisplayName: "Example User",
  passkeyDisplayName: "My MacBook",
  additionalAllowedOrigin: "https://app.example.com"
});
client = create_client(url=url, integration_key=integration_key)
result = await client.passkeys.start_registration(
    user_id="1189c444-8a2d-4c41-8b4b-ae43ce79a492",
    email_or_username="user@example.com",
    user_display_name="Example User",
    passkey_display_name="My MacBook",
    additional_allowed_origin="https://app.example.com"
)

Finish Passkey Registration

Completes the passkey registration process. This should be called after the user has completed the WebAuthn registration ceremony on the client side.

Arguments

Successful Response

Returns an empty response on success.

Error Types

Example request in different programming languages:

const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.finishRegistration({
  userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492",
  publicKey: publicKeyCredential, // from WebAuthn API
  additionalAllowedOrigin: "https://app.example.com"
});

Start Passkey Authentication

Initiates the passkey authentication process for a user. This generates WebAuthn authentication options that should be passed to your WebAuthn library on the client side.

Arguments

Successful Response

Error Types

Example request in different programming languages:

const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.startAuthentication({
  userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492",
  additionalAllowedOrigin: "https://app.example.com"
});

Deregister Passkey

Removes a specific passkey for a user.

Arguments

Successful Response

Returns an empty response on success.

Error Types

Example request in different programming languages:

const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.deregisterPasskey({
  userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492",
  credentialId: "Qig5uty-0-H..."
});

Fetch All Passkeys For User

Retrieves all registered passkeys for a specific user.

Arguments

Successful Response

Error Types

Example request in different programming languages:

const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.fetchAllPasskeysForUser({
  userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492"
});

Configuring Passkey Settings

You can configure passkey settings in the 'passkeys_config.jsonc' file.

Arguments

Example JSONC configuration:

{
    "hostname": "example.com",
    "max_passkeys_per_user": 5
}