erdos
erdos

Reputation: 3538

webauthn usernameless on android chrome

I want to implement a usernameless authentication using resident keys (client-side discoverable credentials) in WebAuthn. This means, I want to use Resident Credentials, so I would not need to first identify the user. According to the specs, I can use requireResidentKey for this.

So first, I am registering for a new resident credential:

const randomStringFromServer = 'CHALLENGE';
const publicKeyCredentialCreationOptions = {
    challenge: Uint8Array.from(
        randomStringFromServer, c => c.charCodeAt(0)),
    rp: {
        name: "Test App",
        id: window.location.hostname,
    },
    user: {
        id: Uint8Array.from(
            "UZSL85T9AFC", c => c.charCodeAt(0)),
        name: "[email protected]",
        displayName: "erdos",
    },
    pubKeyCredParams: [{alg: -7, type: "public-key"}],
    authenticatorSelection: {
        authenticatorAttachment: "cross-platform",
        residentKey: 'required',
    },
    requireResidentKey: true,
    timeout: 60000,
    attestation: "direct"
};

const credential = await navigator.credentials.create({
    publicKey: publicKeyCredentialCreationOptions
});

This triggers the webauthn window. When I select my Android device (Chrome version 105.0.5195.136), the notification is shown on the phone, but tapping on that gives the following screen:


Something went wrong.

The verification method isn't available for this
device. Pick a different option on your other device.

What am I missing here, is it possible to implement usernameless flow on Android Chrome? Are other mobile browsers with better support?

Upvotes: 0

Views: 806

Answers (2)

agl
agl

Reputation: 1682

We hope to have discoverable credential support on Android soon, but it's not currently enabled. If you sign up for the Play Services beta then you'll get it as soon as its available.

For development purposes in the interim, an iOS 16 device should work.

Upvotes: 1

Tim
Tim

Reputation: 1240

Android does not yet support discoverable credentials.

Upvotes: 2

Related Questions