Commit 3f0ebd7
committed
feat: store id instead of encoded raw_id on external_id column
With webauthn-json the create() method expects createOptions of type JSON. However, for using the browser's native API, the create() call must receive the options in type CredentialCreationOptions.
To pass from JSON to CredentialCreationOptions the method parseRequestOptionsFromJSON is used.
parseRequestOptionsFromJSON in turn, expects to receive this format: https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialcreationoptionsjson
Therefore, the credential ids inside excludeCredentials need to be of type Base64URLString, which is not the case now.
As of now, the raw_id is being strict encoded which still doesn't comply with being of type Base64URLString.
Instead of strictly encoding the raw_id, the id attribute starts being stored.
The id is a base64url encoded version of PublicKeyCredential.rawId.1 parent ecae6dc commit 3f0ebd7
File tree
4 files changed
+4
-4
lines changed- app/controllers
- test/controllers
4 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments