m_options.exclude_credentials = exclude_credentials.size > 0 ? &exclude_credentials : nullptr;
// Entity ID
+ // Here we use username as userId for easy user searching in createdCredDescs.
+ // Note that according to
+ // https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialuserentity
+ // userId should not contain personally identifying information about the user,
+ // such as a username or e-mail address.
wauthn_const_buffer_s userId = {reinterpret_cast<const uint8_t *>(m_contents.username),
strlen(m_contents.username)};
m_contents.userId = ToBuffer(userId);