Ceremonies

Registration and Authentication process overview

In WebAuthn, authentication workflows are called "ceremonies" - a term that emphasizes the formal, cryptographic nature of these operations. There are two main ceremonies that form the foundation of WebAuthn authentication.

The Two Ceremonies

WebAuthn defines two distinct ceremonies:

1. Attestation Ceremony (Registration)

Also called: Creation Ceremony, Registration Ceremony

Purpose: Associates an authenticator with a user account

When to use:

  • Creating a new user account with WebAuthn

  • Adding an additional authenticator to an existing account

  • Registering a backup security key

2. Assertion Ceremony (Authentication)

Also called: Request Ceremony, Authentication Ceremony, Login Ceremony

Purpose: Authenticates a user using a previously registered authenticator

When to use:

  • User login

  • Step-up authentication for sensitive operations

  • Re-authentication after session timeout

Common Workflow Pattern

Both ceremonies follow a similar two-step pattern:

Step 1: Options Creation

The Relying Party (your server) creates options that:

  • Define parameters for the operation

  • Include a cryptographic challenge

  • Specify requirements and preferences

  • Are sent to the browser/authenticator

Step 2: Response Verification

The authenticator:

  • Prompts the user for interaction

  • Performs cryptographic operations

  • Returns a signed response

  • The server validates the response

User interaction varies based on authenticator capabilities and your configuration. It can range from a simple button touch to biometric authentication (fingerprint, facial recognition, PIN code).

Attestation Ceremony (Registration)

The attestation ceremony registers a new authenticator credential for a user.

The attestation ceremony

Attestation Flow Breakdown

Server Side (Step 1)

Client Side (Browser)

Server Side (Step 2)

What Happens During Attestation?

  1. Challenge Generation: Server creates a random challenge to prevent replay attacks

  2. User Prompt: Browser asks user to interact with authenticator

  3. Key Generation: Authenticator generates a new public/private key pair

  4. Attestation: Authenticator signs the public key and client data

  5. Verification: Server verifies signatures and stores the public key

  6. Storage: Credential is saved and associated with the user account

Attestation Data Contains

  • Public Key: Used to verify future signatures

  • Credential ID: Unique identifier for this credential

  • AAGUID: Authenticator model identifier

  • Signature Counter: Used to detect cloned authenticators

  • Attestation Statement: Optional proof of authenticator authenticity

Assertion Ceremony (Authentication)

The assertion ceremony authenticates a user with a previously registered credential.

The assertion ceremony

Assertion Flow Breakdown

Server Side (Step 1)

Client Side (Browser)

Server Side (Step 2)

What Happens During Assertion?

  1. Challenge Generation: Server creates a new random challenge

  2. Credential Selection: Browser identifies available credentials

  3. User Prompt: User interacts with authenticator (touch, PIN, biometric)

  4. Signature: Authenticator signs the challenge with the private key

  5. Verification: Server verifies signature using stored public key

  6. Counter Check: Server verifies counter to detect cloning

  7. Authentication: If valid, user is logged in

Assertion Data Contains

  • Authenticator Data: Flags, counter, extensions

  • Client Data: Origin, challenge, type

  • Signature: Cryptographic proof using the private key

  • User Handle: Optional user identifier (for usernameless authentication)

Key Differences Between Ceremonies

Aspect
Attestation (Registration)
Assertion (Authentication)

Purpose

Create new credential

Verify existing credential

JavaScript API

navigator.credentials.create()

navigator.credentials.get()

Server Action

Store new public key

Verify signature

Key Operation

Generate key pair

Sign with private key

Options Class

PublicKeyCredentialCreationOptions

PublicKeyCredentialRequestOptions

Validator Class

AuthenticatorAttestationResponseValidator

AuthenticatorAssertionResponseValidator

User Experience

"Register security key"

"Use security key to sign in"

Security Considerations

Challenge Uniqueness

Both ceremonies require a unique, random challenge:

Challenge Storage

Store challenges temporarily in server-side sessions:

Origin Validation

Always verify the origin matches your domain:

Common Pitfalls

❌ Challenge Reuse

❌ Skipping Verification

❌ Incorrect Origin

Best Practices

✅ Use Timeouts

Set reasonable timeouts for user interaction:

✅ Handle Errors Gracefully

Provide helpful error messages:

✅ Store Credential Metadata

Keep track of when and how credentials were registered:

See Also

Last updated

Was this helpful?