Closed ghost closed 4 years ago
Hi @tomek-bt,
Thanks for the issue report! Sorry I am not sure I totally understand what the issue is...
Are you saying that if you try register with username cool_dude_123
, the registration doesn't work?
If that's what you saying I am not able to reproduce that, can you?
ahh maybe I went about this the wrong way. I dropped into a Javascript console and pasted the function
function strToBin(str) {
console.log(str);
return Uint8Array.from(atob(str), c => c.charCodeAt(0));
}
Then tried strToBin('foo_bar')
, but I can't seem to reproduce this in the web app
Gotcha.
The Encoder uses atob to encode a user id into a ByteArray. This fails on usernames with underscores like
cool_dude_123
(which could be a unique username used by an application).Uint8Array.from
should work here for encoding strings with underscores.This was taken from Duo Security's great writeup on Webauthn.