I have established that a page that I need isn't supported out of the box by Keycloakify, now what?
Keycloakify also enables you to declare custom ftl pages.
Check out how my-extra-page-1.ftl and my-extra-page-2.ftl where added to .
Main takeaways are:
(TS only) You must declare theses page in the type argument of the getter function for the kcContext in order to have the correct typings.
(TS only) If you use Keycloak plugins that defines non standard .ftl values (Like for example that define authorizedMailDomains in register.ftl) you should declare theses value to get the type.
You should provide sample data for all the non standard value if you want to be able to debug the page outside of keycloak.
process.env.PUBLIC_URL not supported.
Using process.env.PUBLIC_URL is not directly supported (but it will be in the future).
As a temporary workaround we you can do:
import { kcContext as kcLoginThemeContext } from "keycloak-theme/login/kcContext";
import { kcContext as kcAccountThemeContext } from "keycloak-theme/login/kcContext";
const PUBLIC_URL = (()=>{
const kcContext = (()=>{
if( kcLoginThemeContext !== undefined ){
return kcLoginThemeContext;
}
if( kcAccountThemeContext !== undefined ){
return kcLoginThemeContext
}
return undefined;
})();
return (kcContext === undefined || process.env.NODE_ENV === "development")
? process.env.PUBLIC_URL
: `${kcContext.url.resourcesPath}/build`;
})();
// Assuming you have my-image.png in your public directory
// you can get an URL for it that will be correct regardless of the context with:
const imageUrl = `${PUBLIC_URL}/my-image.png`;
You can circumvent the problem by avoiding hosting your font yourself using Google Fonts, Font Awesome or any other font provider.
Admin Console Theme not supported
Wellcome page not customizable
The following page isn't customizable yet.
Field Names can't be runtime generated
// OK ✅
messagesPerField.exists("foo-bar")
// Not OK 🛑
const bar= "bar";
messagesPerField.exists(`foo-${bar}`);
Example (and the font are ).
You can , you will need to enable on the server serving your fonts.
If you are missing this feature .
It's however planned to enable this. Follow the progress in .
Keycloakify analyze your code to see what field name are used. As a result your field names should be hard coded in your code (If you are you don't have to worry about it).