目录

Overview

A passkey is an authentication credential based on the FIDO2 standard protocol (see website link disclaimer) for simple and secure sign-in. With a passkey, users can sign in to apps or websites using their fingerprint, their face, or their phone's unlock PIN. Compared with traditional passwords, passkeys offer greater convenience and enhanced security. For more information about FIDO, see FIDO Specifications (see website link disclaimer).

Since HarmonyOS 6.0.0 (20), the passkey feature is added to Online Authentication Kit to support the following capabilities:

Use Cases

The following describes the application scenarios.

[h2]Registering a Passkey

To enable easy, fast, and secure sign-in to local apps or websites, you can create a passkey for users through the passkey registration capability of the passkey service.

[h2]Using a Passkey to Sign In to an App or Website on the Local Device

To authenticate a user who wants to sign in to an app or website, you can use the local passwordless authentication capability of the passkey service.

[h2]Scanning a QR Code to Sign In to an App or Website on Another Device

To authenticate a user who wants to sign in to an app or website on another device, you can use the cross-device authentication capability of the passkey service through QR code scanning.

To support the preceding scenarios, you need to deploy a FIDO server that complies with FIDO2 standards.

Constraints

This function can be used only when the following conditions are met:

Service Process

Registration Process

  1. An app or a browser integrates the passkey module of Online Authentication Kit and sends a registration request to the FIDO server.

  2. The FIDO server returns the registration information (such as a challenge) to the app. The app assembles the registration message and uses the passkey service for registration.

  3. After successful user verification by the authenticator, the passkey service generates a credential key pair. It then uses the preset private key to sign the generated public key and registration information (such as the challenge).

  4. The passkey service returns the signature to the app. The app sends the signature to the FIDO server for registration.

  5. The FIDO server verifies the signature, stores the public key, and returns the processing result to the app.

Authentication Process

  1. An app or a browser integrates the passkey module of Online Authentication Kit and sends an authentication request to the FIDO server.

  2. The FIDO server returns the authentication information (such as a challenge) to the app. The app assembles the authentication message and uses the passkey service for authentication.

  3. After successful user verification by the authenticator, the passkey service uses the stored private key to sign the authentication information (such as a challenge).

  4. The passkey service returns the signature to the app. The app sends the signature to the FIDO server for authentication.

  5. The FIDO server verifies the signature and returns the processing result to the app.