Closed pnzrr closed 1 year ago
Right now the method will only includes items present in the userCredentialMetadatas
array. If that's empty there is no table body.
{
"type": "webauthn",
"category": "two-factor",
"displayName": "webauthn-display-name",
"helptext": "webauthn-help-text",
"iconCssClass": "kcAuthenticatorWebAuthnClass",
"createAction": "webauthn-register",
"removeable": true,
"userCredentialMetadatas": [
{
"credential": {
"id": "a92d933c-80d3-415f-8099-8733c41450ff",
"type": "webauthn",
"userLabel": "WebAuthn Authenticator (Default Label)",
"createdDate": 1680577055435,
"credentialData": "{\"aaguid\":\"00000000-0000-0000-0000-000000000000\",\"credentialId\":\"CdyU+c6k2FDPdjjZvr/2zW/D0JkPqhCTgu8KalP4o8d21EqIFU9Dv+4E3tCZxJDDeNRv4L0W1+phm8YOfqn3uA==\",\"counter\":1,\"credentialPublicKey\":\"pQECAyYgASFYIOoDEllF45pmgQ5t1UvhK-DjbUv2oVHfdPktfkoApXvWIlggHNYT2mEslJZtDFaYg0m7lOenvSh5KEo-xaBmO5OJIQQ\",\"attestationStatementFormat\":\"none\",\"transports\":[\"usb\"]}"
}
}
]
},
@pnzrr the credentials
endpoint returns an array of that object. If there is none with type: webauth
, we should hide that section altogether. Basically what it's doing is showing you all allowable types in the top level array, and then populating the userCredentialMetadatas
in each object if the user has that type.
Ah got you, hide the whole section, not just the table.
On the Signing In page, if there is no type: "webauthn" in the response from /credentials, don’t show a section for Security key
Same for “otp” and “webauthn-passwordless”