Apple icon based on font-awesome
Closed this issue ยท 10 comments
Font awesome bundled with keycloak provides an icon for Apple products https://fontawesome.com/icons/apple?s=solid&f=brands. Can it be incorporated into the plugin?
Workaround:
- Can be fixed with custom theme
- add
kcLogoIdP-apple=fa fa-apple
to theme.properties
Thank you for this great improvement, @EvgeniGordeev ๐
I'll see what I can do here. kcLogoIdP-apple=fa fa-apple
is already a good hint ๐
@stianst: Do you have an idea how we can achieve this directly in this extension?
@klausbetz Not right now, but is something we should support.
Thinking perhaps to extend https://github.com/keycloak/keycloak/blob/main/server-spi/src/main/java/org/keycloak/models/IdentityProviderModel.java to have a "displayIconClasses", with a default implementation (so it doesn't break backwards compatiblity) that just returns null
. Then a custom provider can implement this method to set the default classes.
Next step would be to update https://github.com/keycloak/keycloak/blob/main/services/src/main/java/org/keycloak/forms/login/freemarker/model/IdentityProviderBean.java#L76 to use IdentityProviderModel#getDisplayIconClasses() if one isn't set by a theme.
Would be more than happy to review/merge a PR if you'd be interested in contributing that?
@stianst I created a PR for the changes you proposed. It was way easier to implement than I thought it would be. ๐
Feel free to add your 2 cents to the PR.
As soon as there's a new version of the keycloak dependencies, I'll release a new version of this package including the icon.
Keycloak 20.0.0
is out! ๐
However, it seems like this feature is not as easy to implement as we thought it is. ๐ค
I implemented a work-around (some would call this a fckn dirty hack and I'm not proud of it ๐) in this PR #14, which messes around with the "social"
-data of the login form.
LoginFormsProvider
only works on v19.0.2
and above (cause the constructor of FreeMarkerLoginFormsProvider
was changed in v19.0.2
). Compatibility-wise not ideal.
The main issue is that the new method IdentityProviderModel.getDisplayIconClasses()
is ignored, cause AppleIdentityProviderConfig.java (which contains the override for getDisplayIconClasses()
) is not instantiated for the login form.
See RealmAdapter.java which instantiates
IdentityProviderModel
.
@stianst I'm afraid this PR keycloak/keycloak#14826 for keycloak did not improve the situation. Do you have any idea how the icon can be displayed on the standard login page? If there's no easy way, I'd rather skip this issue and revert the changes from keycloak/keycloak#14826.
To be honest, from a functional point of view this feature has no priority. It's way easier to address this UI feature in a custom theme which the respective keycloak administrator implements.
Moreover, there are visual guidelines from apple which are not covered in this extension as well (which may lead to rejected App reviews from Apple in the worst case).
Yeah!
With the next release of Keycloak the icon should be visible in the standard theme ๐
Just make sure to use 1.3.0
or any later version.
Works, using Keycloak 21. Tested using v1.4.1
.
Closing this ticket is cheap since no one can use this extension with Keycloak 21 effectively, but the icon is still shown on the standard theme.