w3c / webauthn

Web Authentication: An API for accessing Public Key Credentials
https://w3c.github.io/webauthn/
Other
1.16k stars 166 forks source link

username and display name should not be mandatory (rp, challange either) and OS UX should be simplified if not present #1915

Closed r-jo closed 1 year ago

r-jo commented 1 year ago

Description

PublicKeyCredentialUserEntity has mandatory fields by create(): name and displayName even if there is an anonym user id which is given to the server as "user handle" after a get() and what we can and should use for possibly private-as-possible user identification.

These fields should not be mandatory and OS UX should be much simpler if these fields are not used. For simplicity and privacy it is possible not to use phone numbers, emails or user names. OS should create a ux: Creating passkey for xyz.com web domain (which will be synced to your Apple/Google/Microsoft/Third Party pass manager).

I think there is a username fetish which can be tied to passwords that are going to be replaced with device based security (even if private keys are synced and stored, passkey is rather device based if I understand well). With passwords you could log in from everywhere and though you do not really need usernames if the pass is long enough, it was personal and intuitive and now people seem to think it is a must (which is not the case).

We actually do not need usernames anymore. The new way is to have a personal protected OS account even if the device is common. You protect it with biometrics and PIN. The user is tied to devices (actually OS accounts) that (s)he should own. We can use access tokens and crypto keys to create an implicit account and only if the user wants some more robust recovery, we can give a recovery key (a long password without username) or even better as I recon: a passkey which is synced and stored in the pass manager. For normal people it will be Apple and Google pass manager which is ok because those who dont care, save everything via Apple or Gmail anyways. Those who care (gmx, protonmail, 3rd party pass manager etc), can have the option for a third party pass manager as I see (os api).

Again: the user identity is actually the normally 1-3 personal protected os account (and efforts should be made that people create own os account on common devices). The implicit account can be verified via session management and subtle crypto (netflix pushed it and netflix uses it too), actually the same way as by passkeys: private key in browser indexed db non extractable key, public key on server. Of course clearing the browser is equivavalent to device loss, so at the right point, preferably with passkeys users can create explicit accounts where the private key is stored in a pass manager.

I feel some confusion because I do want the same user id/handle and in the specs you see: "the user handle ought not be a constant value...". Well I do not want a user (=user of 1,2,3 devices/os accounts) to create more than 1 account. I think it is again a perversion from the old times. I need one google account actually and if Google makes it possible, I can create more email adresses inside(!) where I switch easily. Nobody needs more than 1 google account but we create burner accounts because every *** website wants our email adress and it can be personal (our name). It is not private against Google that we create more accounts, it is private against web services who want our email adress.

I do not want to fight the system but I want to point out that actually the normal behavior would be to have private anonym accounts without username, email, phone number and add these information if and only if needed (I would add my phone number to Google for recovery since I might recover with my real identity through the phone company but actually 90% of web domains dont need email, phone or usernames).

I think it would be nice to give websites at least the possibility to offer truly private accounts easily without this complexity. However, with this API I have to write something like: xyz.com user as username and citizen of xyz.com as display name and the whole OS UX is overcomplicated. I will never use username or display name, I will use the anonym user id/handle.

In addition, for simplicity, rp and challenge fields should not be mandatory, either. Perfectly fine to use window.location.hostname and if OS needs a random value, they are more than capable to create for themselves if I do not create any... even better because I have no idea if it is needed and 16 or 32 bytes etc. is better or the whole thing is totally unimportant.

Related Links

https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentity

Firstyear commented 1 year ago

@r-jo Ultimately this actually comes down to the RP. In https://github.com/kanidm/webauthn-rs we enforce that the userid is a uuid, and the displayname can be any str input - even blank. This is needed so in a discoverable workflow we have to identify which credential matches to which account. We don't even need to store and PII, but we just need to tie it to the account.

The alternate is to have a way to id the user before to know what credential id's to present as valid in the authentication (non-discoverable) where the RP checks the userid/username first.

The displayname is just for the client side in discoverable to allow the user to ID what user account they are about to use to authenticate, but its NOT transmitted as part of that operation.

Finally, RP and challenge are mandatory and have extremely critical security implications for how webauthn works.

Webauthn does have it's complexities and issues, but "privacy" as you are describing is not one - it's simply up to RP's to implement privacy preserving implementations of webauthn that respect users.

emlun commented 1 year ago

Ironically, the only purpose of user.name and user.displayName is actually to enable username-less authentication. They are never conveyed back to the RP, and non-discoverable credentials do not use these fields at all.

I need one google account actually and if Google makes it possible, I can create more email adresses inside(!) where I switch easily. Nobody needs more than 1 google account but we create burner accounts because every *** website wants our email adress and it can be personal (our name). It is not private against Google that we create more accounts, it is private against web services who want our email adress.

This may be your own experience, but it is not up to the RP to decide whether the user gets to have multiple accounts. In fact, it is an explicit design goal of WebAuthn make it difficult for the RP to detect if a user does (see §14.2.). A user with more than one account does need a user.name and/or user.displayName in order to accurately pick an account to sign in as; this is in fact the only function of these fields.

Also notice in the definitions of name and displayName:

name, of type DOMString [...] The Relying Party MAY let the user choose this value. [...]

displayName, of type DOMString [...] The Relying Party SHOULD let the user choose this, and SHOULD NOT restrict the choice more than necessary.

So even if the RP doesn't care about these fields, it's recommended to still allow the user to set them.

That said, it could in principle make sense to make these fields optional and have the client prompt for them if the RP doesn't set them. It would even make sense to me that the user should be allowed to override the values set by the RP. But I'm not sure it's worth the added complexity - UI could become inconsistent between RPs, for example, which might be more confusing than helpful.

In addition, for simplicity, rp and challenge fields should not be mandatory, either.

I agree with @Firstyear, particularly in the case of assertions. It is critical that the RP chooses the challenge and validates its value echoed in clientDataJSON. If you don't need cryptographic proof of key possession, then you don't need WebAuthn - just use a cookie or local storage instead.

Registrations are slightly different, though. We already provide shortcuts for RPs not interested in verifying the attestation signature, in which case the challenge is also unnecessary. So in principle, we could make challenge optional when and only when the RP sets attestation: "none". But again, I don't think this very marginal benefit is worth the added complexity.

Firstyear commented 1 year ago

So in principle, we could make challenge optional when and only when the RP sets attestation: "none". But again, I don't think this very marginal benefit is worth the added complexity.

And we just know there are RP's that would make challenge optional when attestation is direct/indirect. Better to do the secure and correct thing by default.

r-jo commented 1 year ago

Hallo, thanks for the replies. I had more time with the standard and I try to formulate some concrete suggestions, then I reply to the replies:

SUGGESTIONS: If I read well, anonym user id came into picture thanks to Google. After having one, it should be considered to redesign the following interfaces as follows, making implicitly optional fields explicitly optional for less RP code and clarity and nudges to OS/pass manager UX implementers:

PKCEntity could be an empty interface if still needed (I do not think it is common practice to say something about inheritance in a base interface like "when inherited by then"... very ugly and a sign that the name field should be a level lower...): dictionary PublicKeyCredentialEntity {};

No apparent need for name to be required. Even Adam Langley in his example sets the name to blank which is a very strong sign if not a proof that the field should be explicitly optional (not just implicitly). dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity { DOMString id; DOMString name; };

No apparent need for name or display name to be required. Setting them to blank is ok and privacy friendly. In fact, for future applications, it should be recommended not to use name or display name if not already in use in the account I guess. dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity { required BufferSource id; DOMString name; DOMString displayName; };

No apparent need for rp or challenge to be required. Per default rp can be nameless, only with the domain name as id. I would say it is even best practice since using discovered domain name is better than self naming (and then error handling). Per default attestation is "none". If challenge is required when there is attestation, attestation parameters should be coupled and while attestation parameters are not required, inside attestation parameters the challenge field for attestation could be required. But I think if you need it later you will be forced to set it anyways...

dictionary PublicKeyCredentialCreationOptions { required PublicKeyCredentialUserEntity user; required sequence pubKeyCredParams; PublicKeyCredentialRpEntity rp; BufferSource challenge; unsigned long timeout; sequence excludeCredentials = []; AuthenticatorSelectionCriteria authenticatorSelection; DOMString attestation = "none"; sequence attestationFormats = []; AuthenticationExtensionsClientInputs extensions; };

I am not very knowledgable yet so take this with a pinch of salt from an amateur who has not very deep ideas about webauthn (and not klugscheissen): the whole API could use a rethink where it does not hurt much (at least notes or required -> not required transitions which is better as the other way round since there are already implementations running): around attestation vs no attestation and platform authenticators vs. roaming authenticators I guess. Especially decoupling attestation would be great for RPs who actually are supposed to implement it. I have the feeling that at least 95% use cases will be with platform authenticators and without attestation.

REPLIES: emlun:

firstyear:

emlun commented 1 year ago

What is the privacy issue with name and displayName? These fields are never conveyed back to the RP. The RP does not need to store them. They do not need to represent a unique user identity within the RP's user space.

It may be against some RPs' terms of service for one person to create multiple accounts, but it is not possible for the RP to prevent this using the tools WebAuthn provides. This is by design, because that is a privacy concern. An RP seeking to prevent this must use external tools (cookies, local storage, IP filtering, government ID proofing, etc.) to do so.

You certainly can set name: "Passkey for xyz.com", displayName: "Passkey for xyz.com" for every user if wish to actively sabotage the user experience for users with multiple passkeys on the same authenticator.

(I do not think it is common practice to say something about inheritance in a base interface like "when inherited by then"... very ugly and a sign that the name field should be a level lower...):

I agree, but it is far too late to change this now.

r-jo commented 1 year ago

Hi.

My issue is not really privacy and of course the privacy issue is not explicit since the 2 username fields are implicitly optional. I can skip them by leaving them blank.

If I understand well, the user handle came later on and until then, username was the id too like by practically all accounts with emails as usernames. However, the 2 username fields remain still required in the spec for no good reason, which makes it very ugly for privacy conscious usernameless services to deal with it (leaving it blank? filling with something like "user"? both? just one of them?).

In addition, you always have to fear what the UX implementations will be: will it be only awkward or flat out suspicious if you leave usernames blank? I think the spec has the responsibility to make not required fields not required and guide UX implementers. It should be a totally legal case to use only user id/handle. The api should communicate this.

As I wrote earlier, I do not try to prevent multiple accounts, I know I cannot prevent it, I just pointed out that in my opinion multiple accounts in a domain are not normal. I do not really know what you are talking about since cookies and local storage are

  1. totally ok for session tracking (do you want a passkey verification by each request?)
  2. you cannot prevent multiple accounts with them even if you wanted to since the user moves to a different browser and that was it. And if I have some privacy monster tools like ip tracking or anything to know that a user is someone that has an account by me I can totally prevent creating a second account. It is not up to webauthn design whether I can identify a user with a cookie or ip.

Either you or me is very wrong (probably me?) because you say things like sabotage something with setting the 2 usernames to the same. Even this implies I should set usernames that make sense? As I can see every pass manager uses the user id/handle for passkey entries. There will be 2 entries even if usernames are the same. And of course by leaving usernames blank they will always be the same. Is that a problem now or not?

Again, if I see in a browser that this user has a passkey I will not offer to create one, why should I. If somebody wants another account (even if they should not) they can just go to a different browser and when they create an account with a passkey they get a new user id/handle. I will not set any usernames but they can in their pass managers, for both of their accounts. I do not sabotage anything.

No, it is not too late to change anything. Tomorrow you could change the specs to what I suggested in my previous post since you only have to make fields not required (fields that are actually not required). Nothing would break.

And I did not get an answer to my real questions. Why not make those fields NOT required? I even published all interfaces how they should look (user.name, user.displayName, rp and challenge).

Problem is they are flat out wrong, ugly, make us RPs (each and every RP) write code that makes no sense like: rp: {name: ''} displayName: '' name: '' challenge: crypto.getRandomValues(new Uint8Array(32))

The API communicates to UX programmers that they do not have to think about usernameless entries. As an effect, now, today all 3 big implementations show account chooser for my domain even if there is only one account and the 2 username fields are blank!

This is all because of this bad API. There is a fundamental misunderstanding what is good and what is bad. Privacy issue is usernames and email adresses, your specs knows about it all, see privacy section. Your specs talk a lot about why user id/handle should have no personally identifiable information. And then reality kicks in and you cannot leave out the 2 hanging username fields and of course the whole UX is bloated.

As of now, the UX is sabotaged by a very bad specs. Since optional fields are marked as required, leaving out optional fields by blanking them leads to an awkward UX in reality instead of just: create your passkey for xyz.com or use your passkey for xyz.com

And please do not say that the specs says nothing about UX implementations because you should have take more responsibility. Make these fields truly optional and lets see if it has a positive effect on UX in the future. No way somebody by Apple/Google/Microsoft will write a code that: if a required field string contains only white spaces then... It is NOT the way. If a field can truly be blank, the field is optional and must not be required.

r-jo commented 1 year ago

My real questions. Please do not talk about privacy or something else other than my real question was/still is. My real questions are:

Thanks a lot.

emlun commented 1 year ago
  • Why not make those fields NOT required?
  • What would break, what speaks for leaving them required?
  • Is it bad for some reason to leave them blank?

This:

screenshot-2023-07-24T12:06:50+02:00

That's what you get if you create two passkeys with name: "", displayName: "" with Chrome's virtual authenticator. And similarly, if you create two passkeys with name: "Passkey for demo.yubico.com", displayName: "Passkey for demo.yubico.com" on a YubiKey, this is what you'll see in Firefox:

screenshot-2023-07-24T12:32:29+02:00

How do you propose that "UX programmers [...] think about usernameless entries" when there's more than one? Remember, the browser cannot assume that the user will have only one credential per domain.

in my opinion multiple accounts in a domain are not normal

Nevertheless, there are many valid reasons a user may have them. When they do, the UI needs to be equipped to help the user distinguish which passkey goes to which account. That is why these fields are required.

  • What is the actual solution for usernameless services? What should I do with these 2 username fields?

Ask the user for a value, maybe describe it as a "passkey label". You do not need to store that value; it will never be conveyed back to you. Or set all three to the same user ID, if you have one suitable for human consumption. Or generate a random name for the account and its passkeys. As long as there's something the user can use to distinguish passkeys for different accounts.

emlun commented 1 year ago

2023-08-16 WG call: There seems to be nothing more to discuss here; closing.

r-jo commented 1 year ago

Hi, of course there may be multiple accounts, I said it should not be the default thinking. The default should be one account and then the UX would be very nice and simple. In case the user creates more accounts, the user has to set appropriate labels in the pass manager. It is not possible to control the pass manager label from the server side. Thinking more about it, my opinion became just stronger: the username fields should NOT exist. It should be a minimum to make them optional instead of required.

The internal logic of webauthn is usernameless and it will be extremely confusing if this thing is not cleared. I would make them optional because deleting them is not backward compatible. Actually implemetors should also be warned to handle absence of this fields if made optional. I know it is a mess, but it will be a bigger mess if you leave it as it is.

For more details and the first website people struggling with this check out: https://stackoverflow.com/questions/76330306/user-name-and-displayname-change-for-existing-passkey/76663224#76663224 https://stackoverflow.com/questions/73562080/webauthn-how-to-get-rid-of-the-username-requirement/76920460#76920460 I provided answers too if somebody is interested.

I do not have time for this anymore. But I am 100% convinced, more than when I created this thread some time ago that this is a crucial mess up. It is not just simply logiacally awful to force usernames in an otherwise usernameless logic but messes up people who try to implement passkeys in their web service.

Moreover, the BAD pass manager UX is also because of this mess up. Even if only one account (which should be NORMAL) there is a lot of unnecessary text in the pass manager, an account choser as extra step blaahhh... instead of "use the passkey for xyz.com"

Simply put: you cannot and should not micromanage the pass manager labels from the server side. And in the webauthn logic, the 2 username fields are nothing more than labels. They can be changed by the user anytime in the pass manager without the "relying party" knowing about it. They are in the power of the user and the responibility of the user.

Even accounts with usernames would learn in absence of username fields at least the true nature of passkey authentication. But if any, an optional note field would be much better instead of 2 username fields. You want to sell passkeys as very easy but it would be better to be clear from the very beginning what is whose responsibility and pass manager labels management is not the webservice providers responsibility.

Again, it is a self-discussion about deleting username fields from the spec vs. 1 or 2 optional fields. MAking the fields required is 100% wrong.

emlun commented 1 year ago

Yes, WebAuthn doesn't need the usernames internally, but human-comprehensible labels are still needed for human end-users to understand and what each passkey is for.

Also, it occurred to me just now that your original ask is based on a false premise:

These fields should not be mandatory and OS UX should be much simpler if these fields are not used.

But the reality is that if they were optional, then the client UI would have to have more steps than if they were set, not fewer. As established above, it's not feasible to leave passkeys without a user-comprehensible label, so the client would have to ask the user for one if the RP doesn't.

Then if the user chooses to create another passkey for the same account on an additional authenticator, they'll probably want the same label on both passkeys. The RP is better equipped than the client to choose and remember a suitable "account label" for any future passkeys the user may choose to create for the account.

I fully agree that choosing suitable values for user.name and user.displayName in a username-less application is difficult - I'm experiencing this firsthand right now in a project I'm working on - but making the fields optional is not an appropriate solution. At its core, this is an inherent challenge in the very concept of username-less accounts.

r-jo commented 1 year ago

I did not answer your questions because I think I did them before but again:

If it is optional, not required, others who fear those screenshots you published can set the starting username or note fields in the pass manager. Your reply was an argument against deleting the fields not against making them optional.

If it is optional, I can decide that I dont give a shit about users who create more than one accounts. It is not normal and I do not support multiple accounts and I do not use usernames or personal identifiers!

For such websites if a user creates multiple accounts, which it can, then it is of course his/her responsibility to manage in his/her pass manager labels... in my service, in a usernameless account, there are no such labels because it makes no sense to have more than one account.

Your thinking is very tied to the fact that everybody uses burner accounts and multiple accounts but it does not make it normal. Do you have more accounts by your bank? Do you have more real digital identity account in your country?

And no, I do not want to prohibit it, I cannot prohibit it but it is not my responsibility if a user creates 2 usernameless accounts in a web domain and doesnt have any idea which is which.

Hint: enter both accounts, know why you created them and why you need them how you want to distinguish them (you are on pro level in one account and the opponents are too strong and you want to create a new one where you seem to be an amateur and enjoy being super dominant, then call them pro and amateur in your pass manager, or call them 1 and 2 I dont care).

And I suggested for example

Another example, a usernamless account with the option(!) of email recovery could let the user manage the labels which could be the email adresses (if the user has no idea, enter account with label 1, check email, then replace label in the pass manager to email adress)

A nicer website could suggest the email adress as label. But actually, I would not do this because it makes usually no sense to have real users create multiple accounts.

The users are not babys. Websites should not micromanage things that they actually have no power or responsibility over.

r-jo commented 1 year ago

I really dont have time for this but you simply state logically false statements!

You do not even realize there are 3 possibilities for the 2 username fields or whatever pass manager labels you want relying parties to micro manage or suggest:

  1. required in the specs as of now
  2. optional
  3. deleted

You repeatedly argue against 3. (and even if 3 was possible and desirable with a radical rethink, please note that I ACTUALLY SUGGESTED 2. and do not argue against 3 like you would argue against me and my suggestion because you falsely imply I want 3... I realize that 3. is too late now, also it is a more difficult thing to argue against. In addition, 3. is very radical since it goes against some typical wrong pattern of existing multiple accounts, correctly labeled with different emails or such. And I never said those websites should not set these email fields for the users in the pass manager for simplicity, even if the pass manager label is actually the responsibility of the user).

Let us see your last answer block, statement by statement: A: "WebAuthn doesn't need the usernames internally"

B: "human-comprehensible labels are still needed for human end-users to understand and what each passkey is for"

C: "your original ask is based on a false premise" , "if they were optional, then the client UI would have to have more steps than if they were set" , "the client would have to ask the user for one if the RP doesn't"

D: "The RP is better equipped than the client to choose and remember a suitable "account label""

E: "I fully agree that choosing suitable values for user.name and user.displayName in a username-less application is difficult"

Please RE-THINK, I still have some hopes:

r-jo commented 1 year ago

And I am not happy that this thread was closed! It is very hostile towards open discussions. Forcing username fields will cause problems whether you close discussions about it or not. Let us close it after some time like 6 months so that other people may discover this topic better and tell their opinions. RPs just start to implement things.

ryanshahine commented 1 year ago

@r-jo

Your points are valid, but it's essential to recognize diverse user behaviors and needs. People often manage multiple accounts for various reasons: personal, work, testing, and more. While single accounts might work for some, many users appreciate the flexibility of managing different accounts efficiently. Comparisons to bank accounts or digital identity accounts don't fully reflect the web service context, where varying roles and purposes call for multiple accounts.

Do you have more accounts by your bank?

I do have multiple accounts at one bank.

The core issue you've raised seems to be more about the UX design around the passkey management process, rather than the necessity of name labels themselves. Instead of focusing solely on the name labels, perhaps a better approach would be to consider streamlining the user interface. For instance, if there's only one account associated with a passkey, the name selector could be skipped, and the user could be directly prompted to enter their passkey. On the other hand, if multiple accounts are detected, the interface could show the account selector to help users choose the appropriate account.

By shifting the emphasis to refining the user interface and experience, we can address your concerns while still maintaining the necessary labeling for passkey differentiation. This approach could potentially lead to a more intuitive and user-friendly interaction, catering to both the single-account and multi-account scenarios.

ragnarbull commented 9 months ago

@r-jo while some of your points are valid you could have gone about this way better. Posting huge amounts of text, downvoting people who respond (literally the very people who are the WebAuthn spec members) and yourself being somewhat disrespectful (even hostile as you call it) never ever works to persuade anyone who is in a position to back your ideas.

Also as others said the security implications of some of what you're proposing (eg. not having a challenge) are high and show a lack of understanding (on your part) of the spec. Further, users should be allowed to create multiple accounts - imagine if you could only have one Google account with your security key and you need to delete it (and your account?) to make another. It's up to you as a RP to work through multiple accounts not the spec.

I agree some of the UX is not the best yet (eg. Sign-in when you the user hasn't set a key with that device) and many users are definitely confused by passkeys - it would better to have a single issue for these.

r-jo commented 9 months ago

hi i dont have time for this now, but i read your reply in 5 seconds in my email so i must add my part

so the RPs should write one-account logic without usernames and yes it would be great to have this by google etc... do you have more apple IDs? it is just like email is not always anonym and you want anonym accounts etc... or cheat with drive space... then you need an alias email for the same account and google may give you 3x15gb... not more

ragnarbull commented 9 months ago

I'm going to mostly ignore the end of 3. for obvious reasons except to say that of course there are benefits in pushing WebAuthn for all of the players you mention; but there are huge benefits for users too both in security and in ease of use (the UX needs work as we all point out). Also what's not clear about how discoverable creds are created? It's not some conspiracy... you can create your own authenicator and get it FIDO certified.

If you also want something more secure for your app and that still uses WebAuthn then derive keys using the PRF extension (unfortunately not available on all OS/client/authenticator combos) and hold the final login until these have been derived, set and the data decrypted (ie. E2EE). More than happy to share code if you're interested. And yep some of it is defintely "hacky" when trying to go usernameless and anon but ironically this actually gives your users greater privacy. Also I'm sure you've heard of the Signal Protocol - that's probably what you're looking for but it is very complex and probably easy to make a mistake.

Like I said, some of what you're saying is great albeit mashed up with some topics that no-one wants to discuss, at least on GitHub. PS. you have "...not be mandatory (rp, CHALLENGE either) ..." in the issue title and also mentioned it.

r-jo commented 9 months ago

hey, thanks for the reply, I am not looking for anything else than a great way to provide my users a simple and secure authentication solution: trusted device + biometrics (device code)

of course webauthn can be implemented great, I enter my google account on a windows machine with my fingerprint, vow (on my linux pc hmmm...)

the question is the broader design and whether it will be (should be) widespread, will 50%+ web domains implement it?

of course not, because it has the flaws I discussed... the biggest problem is that a ruling solution requires the secret to be backupable (like bitcoin BIP39 or something)... or else the whole thing is federated again (apple, google, pass manager) and nobody wants to (and nobody should want to) be dependent of the pass manager completely... the secrets must be exportable... that is my opinion and if only 10% of people think so, no web domain or service will implement only passkeys in this form... and what is actually the big advantage of passkeys IF there is a backupable secret key anyways? you should have understood that there always be some backupable secret key because why should I add passkeys if I already use a recovery key (if the user wants it, on paper, if the user wants it easy in pass manager with some local disk encrypted backup etc...) and the browser can do ECDSA too, just like passkeys? the only thing is missing is biometrics. I would have never implemented passkeys if there is a better way for biometrics on the web.

the trade off is you DO have a readable backup but you hopefully rarely or never really use it... if you create passkeys this way, there will be other solutions and why would I complicate my life with passkeys? I can do it in the browser (now without biometrics because webauthn has monopoly)

but my REAL SMALL problem is that you do not even consider minimal changes like making username fields NOT required... you do not even discuss what is right what is not right... you do not even seem to understan that the whole webauthn logic is usernameless, you did it this way and then required 2 username fields...? come on!

I do not want to circumvent it, I do not want to hack it, I want to write 5-10 lines in js with the really important fields, I want to know from the interface and specs which fields are really important... and that is it... the UX cannot improve on BAD LOGIC! what should a UX writer do if a fied is REQUIRED? then they have to do something with the string inside, even if it is ""... the fact that people want to put "" is a proof that something is smelly (should not be required field.... if the field is not required, the UX implementer HAS to create an if-else... if it is not there, vow, then no field... then they think about it, vow, if it is not there, one account, no multiple account, we do not need 80% of UX stuff here... just sign in to xyz.com with your passkey, that is it!

if a second account is created with a different id, then we prompt the user to manage the username labels because logically it is NOT authentication logic by passkeys but pass manager multi-account labeling logic... I can change this label on android now and I can sign in...

PS: I do not have the time but at one point challenge is crucial (the random server challenge that is signed over) at another point there is some challenge we never do anything with, as far as I can remember it has something to do with attestation that is not happening 99,9999% so we have to generate a random something that has no use... it may only be bad if an RP gives a non-random something... if we do not need it, we should not be made to create it, it is obvious... again, if someone needs it, it can be optional and if there is no challenge, the party that actually does something with it and has more security knowledge than an average RP creates a random something... PS2: did anyone by webauthn really implemented as an RP the stuff? because it is a great practice to face your monster... I did it, it is horrible, one can do it, full with not needed required fields, you questions yourself the whole time why they are required and then after some time and work you realize the whole thing is messed up: overcomplicated reality-fern start if you ose all your devices you are out... then apple, google etc. wants something commercially, and they do it their way, especialyl apple cares nothing about windows, linux, android... buy all apple and then everything works great, synced etc... or use your iphone to log in... come on! and somebody (google) makes it usernameless but the username fields stay there etc... the whole thing is a big mess up instead of a nice design with super math like ECDSA, preferably deriving ECDSA keys from a backupable secure key that is readable to humans... the logic should be trusted device + biometrics and start again, not this historically grown monster that fido2-apple-google-microsoft-webauthn sh... is

r-jo commented 9 months ago

some questions:

so tell me, why do we need to create in js a random number for this, if there is practically no attestation logic we want or even if we want, apple simply does not implement it? why is it REQUIRED? I mean all you actually need are the code below, and PLENTY of other stuff you must include with blanks or default values that 99,9999% will use but are not default in the specs... the real deal is generating the PID on server, giving by creation, choosing algo, then by get give a random challenge and check the signature later on server with the public key... it would also be nice if someone who actually wants to be this widespread provided the MOST simple code needed, without libraries... I mean I even had to write derToRaw() functions etc... getting info out of signature is a nightmare... it could be EXTREMELY SIMPLE code on client and server... it is not that complicated, I did it in js and java, but I can tell you now that an avergae RP will not want this and even if wanted, not capable, and not because it is that complicated but because the very simple stuff was made overly complicated with design horrors... I mean next time a good test: gather 10 RPs and if they cannot do this in a day and have a joyful face at the end of the day and practically no questions, THEN it is simply NOT OK yet... I mean you can write NOTEs in the specs... I could make this working in 2 weeks alone, with wonderful understandable specs for the 99,9999% of RPs... but actually I think even if usernames and other shit disappeared and good notes and good example codes, this is the SMALLER part where I wanted to help you with my actual RP implementer experience... the BIGGER problem is backup... I think you should find a backupable format and derive ECDSA keys from them, there is an RFC for it and of course you just have to check out parts of bitcoin stuff: https://www.rfc-editor.org/rfc/rfc6979.html the whole model is bad because if it wants to win, it has to be backupable... I mean passkey is not really secure if you have another system where you recover with gmail... then it is just hokus-pokus [I call the private key passkey]

function getPkcCreateOptions(pid) {
    return {
        //user is passkey holder (no names required)
        user: {
            //passkey id (PID) created on server, should not have personally identifying information
            id: _base64UrlToArrayBuffer(pid),
        },

        //only ecdsa 256 (rsa option means much more complex code)
        pubKeyCredParams: [{type: 'public-key', alg: -7}],
    }
}

function getPkcRequestOptions(challengeArrayBuffer) {
    return {
         //the random dynamic server challenge that will be signed over with the passkey and returned to server along with the PID and signature
        challenge: challengeArrayBuffer,
    };
}
Firstyear commented 9 months ago

so tell me, why do we need to create in js a random number for this, if there is practically no attestation logic we want or even if we want, apple simply does not implement it? why is it REQUIRED?

If you don't make it required people won't do it.

It allows a registration to enforce that the registration we are being sent is genuine and related to the caller that initiated the registration call. It prevents replays.

if it wants to win, it has to be backupable...

This is why RP's allow you to register multiple credentials.

You aren't backing up a single private key. You enroll multiple keys, and can individually revoke them in the case of loss.

I can tell you now that an avergae RP will not want this and even if wanted,

This is why you use libraries like https://docs.rs/webauthn-rs/0.4.8/webauthn_rs/ which does everything for you and has been through security audits to ensure properly handling of credentials.

There are genuine issues in the Webauthn space, but they are not the ones you are raising here.

I think this conversation has gone far enough though.

arianvp commented 9 months ago

You can see the challenge check in the registration even if it's not signed by an attester as a mandatory CSRF token. It still has its use even-though it's not signed!