8000 Update WebAuthn Metadata service and show icons by mabartos · Pull Request #48551 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Update WebAuthn Metadata service and show icons - #48551

Merged
rmartinc merged 2 commits into
keycloak:mainfrom
mabartos:passkeys-logos
May 11, 2026
Merged

rmartinc merged 2 commits into
keycloak:mainfrom
mabartos:passkeys-logos

Conversation

@mabartos
@mabartos mabartos commented Apr 28, 2026 •
Copy link
Copy Markdown
Member

Details

  • Update the WebAuthn medata service data from the community passkeys project (recommended) - we previously used a proxy library that used the same, but striped out icons + not up-to-date)
  • Add authenticator provider icons (light/dark theme) to WebAuthn credentials, displayed in the Account Console and login page
  • Parse the keycloak-webauthn-metadata.json at Quarkus build time
  • Removed transport type from the login theme
  • More info in the issues

Account UI

Old

Screenshot From 2026-04-28 11-32-26

New

Screenshot From 2026-04-28 14-45-10

Login UI

Old New
Screenshot From 2026-04-28 11-30-59 Screenshot From 2026-04-28 14-45-34

@mabartos mabartos changed the title Update WebAuthn Metadata service data and show icons Update WebAuthn Metadata service and show icons Apr 28, 2026
@mabartos
mabartos marked this pull request as ready for review April 28, 2026 13:37
@mabartos
mabartos requested review from a team as code owners April 28, 2026 13:37
@mabartos mabartos self-assigned this Apr 28, 2026
@mabartos
Copy link
Copy Markdown
Member Author

We might potentially remove the transport information from the login UI, as it might not be something that the user would want to care about IMHO - even for some security keys using the BLE, or NFC? When there's the label for the specific authn + authenticator type, the authenticator should be easily recognized without the need to know the transport type. WDYT?

edewit
edewit previously approved these changes Apr 29, 2026
@mabartos
mabartos requested a review from rmartinc May 4, 2026 08:55
@rmartinc rmartinc left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mabartos! The presentation looks much better but I don't know if we should parse the file and use real image files instead of the inline data. Something in the lines I have done in this branch. I created a quick python file that parses the json and creates the files and prints the new json. The files has been copies to login theme and account.

I don't know what it's better. I see pros and cons for the two options. Just for your consideration.

@mabartos
mabartos commented May 5, 2026
Copy link
Copy Markdown
Member Author

@rmartinc I tried to prevent storing these icons at all, but it will be probably better than using the base64 encoded SVG/PNG files. As even with the browser caching, it might be better than keeping it in memory - as some icons can be close to 64kB + the encoding... I don't see any harm to include directly the parsed icons in the /public folder... but we should probably use more specific path like /public/passkeys.

I'll update the PR, and reuse some of your logic. Thanks!

@mabartos
mabartos marked this pull request as draft May 5, 2026 11:31
@mabartos
mabartos force-pushed the passkeys-logos branch 3 times, most recently from 1083909 to 9b29601 Compare May 5, 2026 15:35
@mabartos
mabartos marked this pull request as ready for review May 5, 2026 15:35
@mabartos
mabartos commented May 5, 2026
Copy link
Copy Markdown
Member Author

@rmartinc Updated.

rmartinc
rmartinc previously approved these changes May 5, 2026
@rmartinc rmartinc left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @mabartos! I see there are dark icons, I should have done something bad in my script because previously there were only light. 😄
The increase in size for the zip is less than 2MB so I suppose we can cope with this.

@mabartos
mabartos commented May 6, 2026
Copy link
Copy Markdown
Member Author

@rmartinc Yes, there were some issues in the script, so it should be fixed now + provide guidance for future us on how to update the metadata.

I've just added a simple changes to default icons when there's no provider found - just to cover all cases (should happen only in tiny amount of cases)

Screenshot From 2026-05-06 16-40-52 Screenshot From 2026-05-06 16-40-32

mabartos and others added 2 commits May 7, 2026 14:10
Closes keycloak#48539
Closes keycloak#48540

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: rmartinc <rmartinc@redhat.com>
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
@rmartinc rmartinc left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mabartos! LGTM!

@mabartos
Copy link
Copy Markdown
Member Author

@edewit Thanks for the feedback! Do you want to review the last JS/TS changes?

@rmartinc Or are we ready to go?

@edewit edewit left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good from a UI point of view

Comment on lines 123 to +150
const items = [
...(showIcon
? [
<DataListCell
key="icon"
data-testrole="icon"
className="pf-v5-c-data-list__cell pf-m-icon pf-v5-u-display-flex pf-v5-u-align-items-center pf-v5-u-pt-0"
>
<div className="pf-v5-c-icon pf-m-xl">
<picture>
{iconDarkSrc && (
<source
srcSet={iconDarkSrc}
media="(prefers-color-scheme: dark)"
/>
)}
<img
src={iconSrc}
alt=""
width="40"
height="40"
style={{ maxWidth: "none" }}
/>
</picture>
</div>
</DataListCell>,
]
: []),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit of a nit pick, but you don't need the spread operator:

Suggested change
const items = [
...(showIcon
? [
<DataListCell
key="icon"
data-testrole="icon"
className="pf-v5-c-data-list__cell pf-m-icon pf-v5-u-display-flex pf-v5-u-align-items-center pf-v5-u-pt-0"
>
<div className="pf-v5-c-icon pf-m-xl">
<picture>
{iconDarkSrc && (
<source
srcSet={iconDarkSrc}
media="(prefers-color-scheme: dark)"
/>
)}
<img
src={iconSrc}
alt=""
width="40"
height="40"
style={{ maxWidth: "none" }}
/>
</picture>
</div>
</DataListCell>,
]
: []),
const items = showIcon
? [
<DataListCell
key="icon"
data-testrole="icon"
className="pf-v5-c-data-list__cell pf-m-icon pf-v5-u-display-flex pf-v5-u-align-items-center pf-v5-u-pt-0"
>
<div className="pf-v5-c-icon pf-m-xl">
<picture>
{iconDarkSrc && (
<source
srcSet={iconDarkSrc}
media="(prefers-color-scheme: dark)"
/>
)}
<img
src={iconSrc}
alt=""
width="40"
height="40"
style={{ maxWidth: "none" }}
/>
</picture>
</div>
</DataListCell>,
]
: [];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edewit Thanks for the input. I think we're ok as is for now based on my information about the spread operator. We can improve it in some other PR.

@rmartinc
rmartinc merged commit 9d1e562 into keycloak:main May 11, 2026
89 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
* Update WebAuthn Metadata service and show icons

Closes keycloak#48539
Closes keycloak#48540

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: rmartinc <rmartinc@redhat.com>

* Revert back the transport type for providerId-less authenticators

Signed-off-by: Martin Bartoš <mabartos@redhat.com>

---------

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: rmartinc <rmartinc@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support icons for Passkeys credentials Update WebAuthn Metadata service data

3 participants

0