Keycloakify
HomeGitHubStorybookStarter TemplateAlternative to keycloak-js
v10
  • Documentation
  • Release Notes & Upgrade Instructions
  • FAQ
v10
  • 👨‍💻Quick start
  • 🧪Testing your Theme
    • In Storybook
    • In a Keycloak Docker Container
    • With Vite or Webpack in dev mode
  • 🔩Integrating Keycloakify in your Codebase
    • In your React Project
      • In your Vite Project
      • In your Webpack Project
    • As a Subproject of your Monorepo
      • Turborepo
      • Nx Integrated Monorepo
      • Package Manager Workspaces
  • 🎨Customization Strategies
    • CSS Level Customization
      • Basic example
      • Removing the default styles
      • Applying your own classes
      • Page specific styles
      • Using Tailwind
      • Using custom assets
        • .css, .sass or .less
        • CSS-in-JS
    • Component Level Customization
      • Using custom assets
  • 🖋️Custom Fonts
  • 🌎Internationalization and Translations
  • 🎭Theme Variants
  • 📝Customizing the Register Page
  • 👤Account Theme
    • Single-Page
    • Multi-Page
  • 📄Terms and conditions
  • 🖇️Styling a Custom Page Not Included In Base Keycloak
  • 🔧Accessing the Server Environment Variables
  • 🎯Targetting Specific Keycloak Versions
  • 📧Email Customization
  • 🚛Passing URL Parameters to your Theme
  • 🤵Admin theme
  • 📥Importing the JAR of Your Theme Into Keycloak
  • 🔛Enabling your Theme in the Keycloak Admin Console
  • 🤓Taking ownership of the kcContext
  • 📖Configuration Options
    • --project
    • keycloakVersionTargets
    • environmentVariables
    • themeName
    • startKeycloakOptions
    • themeVersion
    • postBuild
    • XDG_CACHE_HOME
    • kcContextExclusionsFtl
    • keycloakifyBuildDirPath
    • groupId
    • artifactId
    • Webpack specific options
      • projectBuildDirPath
      • staticDirPathInProjectBuildDirPath
      • publicDirPath
  • FAQ & HELP
    • 😞Can't identify the page to customize?
    • 🤔How it Works
    • 😖Some values you need are missing from in kcContext type definitions?
    • ❓Can I use it with Vue or Angular
      • Angular
    • ⚠️Limitations
    • 🛑Errors Keycloak in Logs
    • 🙋How do I add extra pages?
    • 🤓Can I use react-hooks-form?
    • 🚀Redirecting you users to the login/register pages
    • 💟Contributing
    • ⬆️Migration Guides
      • ⬆️v9 -> v10
      • ⬆️CRA -> Vite
      • ⬆️v8 -> v9
      • ⬆️v7 -> v8
      • ⬆️v6 -> v7
      • ⬆️v6.x -> v6.12
      • ⬆️v5 -> v6
    • 🍪Google reCaptcha and End of third-party Cookies
    • 🔖Accessing the Realm Attributes
  • ⭐Sponsors
Powered by GitBook
On this page
  • Deciding if you need an account theme or not
  • Choosing an account theme type
  • Single Page
  • Multi Page

Was this helpful?

Edit on GitHub

Account Theme

Last updated 8 months ago

Was this helpful?

Deciding if you need an account theme or not

The first question you want to ask yourself is: "Do I really need an account theme?"

If you're looking to create an account theme just to allow your users to change their password, update account information such as email, phone number, favorite pets, etc., or delete their account, then you do not need an account theme.

There are pages in the login theme for those functions. You only need to add a button to redirect your user to the appropriate page in your main app. Here is how to do it with oidc-spa: .

An added benefit of not having an account theme is that you will reuse the exact same form that you created for the registration page in the login-update-profile.ftl page.

Consider creating an account theme only if you need to provide advanced account management features to your users, such as connection logs, management of active sessions, file uploads, etc.

Here is a video that explains this in detail:

Choosing an account theme type

Keycloakify provide you two ways to create your own account theme.

You can chose between two implementation of the account theme:

Single Page

Pros

  • Get's all the latest features.

  • The base code is maintained by the Keycloak team and automatically integrated into Keycloakify. You're using the real thing, not a fork.

  • If you're a React developper you'll feel right at home. It's uing i18n-next and react-router

Cons

  • Opting for this option will add a lot of dependencies to your project (i18n-next, react-router-dom, patenrnfly and more).

  • No Storybook support.

  • No npx keycloakify eject-page CLI, you'll have to manually copy paste from the source the components you want to take ownership over.

To get started with the Single-Page account theme:

Multi Page

This is a fork of the Account v1 maintained by the Keycloakify team.

Pros

  • Works exactly the same as the login theme, nothing new to learn.

  • Storybook support

  • CSS level customization support just like in the login theme.

  • As it's maintained by us, we can guarenty a certain level of stability in future version of Keycloak.

  • Compatible with all Keycloak version.

  • Does not add any dependency to your project.

Cons

  • It relies on Java code maintained by us, this code uses Keycloak internal API, you have to trust us to keep maintaining it.

  • The default look is a bit dated (as of today, we'll update it).

To get started with the Multi-Page account theme:

The Single Page theme also refered as account v3 is this the default theme that comes with Keycloak 25. .

CSS level customization beyond is not practical, you'll have to customize at the React component level.

When upgrading to a future version of Keycloak, there’s a possibility that your account theme may break. If your customizations are limited to styles, updating should be straightforward—simply bump the version number of in your dependencies. However, if you’ve made customizations at the React component level, migrating to the new version could require substantial effort due to potential extensive changes in the underlying code. The Keycloakify team cannot guarantee a specific level of stability for these modifications, as they are not part of our codebase.

Don't come with all the feature out of the box yet. You'll have to use the .

👤
But thanks to Keycloakify's compatiblity layer it works with older Keycloak versions down to 19
overidding the Paternfly CSS variables
the Account UI
Single-Page
Keycloak Account REST API if you want to implement them
Multi-Page
Documentation
Screenshot of the Single Page Account theme