Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User friendly credential ID string for troubleshooting #2256

Open
timcappalli opened this issue Feb 10, 2025 · 0 comments
Open

User friendly credential ID string for troubleshooting #2256

timcappalli opened this issue Feb 10, 2025 · 0 comments
Assignees

Comments

@timcappalli
Copy link
Member

timcappalli commented Feb 10, 2025

Proposed Change

Troubleshooting WebAuthn with end users can be difficult, especially remotely (e.g. a chat or call). Most WebAuthn credential identification done today is via either user-provided friendly names, or automatically generated names based on AAGUID. This isn't super useful to support folks when troubleshooting as they don't uniquely identify the credential to both the user and the RP support staff. Today, the only other real option is for an RP ID to show the credential ID, and authenticators would need to do this same. Credential IDs are variable in length and are often long, making them not very user friendly.

A basic method would be to concat the RP ID and credential ID, SHA-256 hash it and then return the last 6 characters.

sha256(rpId, credentialId)

import { createHash } from 'crypto';

const concatenateAndHash = (str1: string, str2: string): string => {
    const concatenatedString = str1 + str2;
    const hash = createHash('sha256').update(concatenatedString).digest('hex');
    return hash.slice(-6); // Get the last 6 characters
};

const result = concatenateAndHash("webauthn.io", "SwAuYQuh0LlVDdH7sQVsDQ");
return result;

Result: b4c52f

Why define in WebAuthn?

While this proposal would not change the shape or function of the WebAuthn API, this string needs to be consistent across authenticators, clients, and Relying Parties, so defining the derivation of the user friendly identifier is important. WebAuthn is the logical home for this. The spec would simply define the derivation procedure above and potentially give this thing a name (e.g. "Key ID").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant