LogoLogo
Github
  • 👋Welcome to Android-Credential-Manager Docs
  • 🖐️Getting Started
    • 🔧Installation
    • 📃Digitial Asset Linking
  • ➕Creating Credentials
    • Overview
    • Saving Username and Passwords
    • Creating a Passkey
    • Error Handling
  • 🧑‍💻Login Users
    • Overview
    • UserName and Password
    • Passkeys
    • Google Sign In
    • Error Handling
    • Performance Improvements
Powered by GitBook

2025 GuhanSenSam

On this page
  1. Creating Credentials

Creating a Passkey

Prompt your users to save a new passkey for faster login

PreviousSaving Username and PasswordsNextError Handling

Last updated 3 months ago

Passkeys is a a relatively new concept that Google has introduced to its mobile ecosystem in order to improve authentication ease while increasing security over simple passwords. Passkeys under the hood use cryptographic keys in order to allow for authentication, but Google presents these keys in the form of your device's screen lock and or bio metrics. Passkeys are not meant to replace passwords yet but are instead an alternative login method to the traditional password method.

Create a new Passkey

To create a new passkey, use the following code:

import { CredentialManager } from "credential-manager/CredentialManager";
CredentialManager.createPassKey(
      new PassKeyCreator({
        app: {
          name: "Android-Credential-Manager", // Name of the App stored in the cred
          domain: "guhansensam.com", // Domain where your Digital Assets are stored
        },
        challenge: "abc123", // Must be Base64 Encodable
        user: {
          displayName: "Guhansen Sam", // Display Name of the User
          id: "1234567890", // Unique Identifier for the User
          name: "guhansensam", // Username of the User
        },
        timeout: 180000, // Timeout in milliseconds
      }),
    );

Make sure you provide the domain that you registered in your Digital Asset Links file in order for your saved passkeys to work for both your app and your website.

For more information on what these fields are please refer to the for passkeys support.

➕
official documentation
Creating a new Passkey
Creating a Passkey