You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom GroupStorageProvider in Keycloak is recognized but not registered
#20222
I have created a custom GroupStorageProviderFactory and an accompanying GroupStorageProvider for Keycloak's Docker image (quay.io/keycloak/keycloak:18.0.0) version 18.0.0 as below:
public class XylemGroupStorageProviderFactory
implements GroupStorageProviderFactory<XylemGroupStorageProvider> {
static String ID = "xylem-group-storage-provider";
protected static final List<ProviderConfigProperty> CONFIG_PROPERTIES;
static {
CONFIG_PROPERTIES = ProviderConfigurationBuilder.create()
.property().name("enabled")
.type(ProviderConfigProperty.BOOLEAN_TYPE)
.defaultValue("true")
.add()
.build();
}
@Override
public String getId() {
return ID;
}
@Override
public XylemGroupStorageProvider create(KeycloakSession session, ComponentModel model) {
GroupStorageProviderModel groupModel = new GroupStorageProviderModel(model);
groupModel.setEnabled(true);
return new XylemGroupStorageProvider(session, groupModel);
}
@Override
public List<ProviderConfigProperty> getConfigProperties() {
return CONFIG_PROPERTIES;
}
}
I even went overboard to set enabled properties for it, but it should not have been necessary as I have a few other custom providers which are all enabled and work by default. This particular provider does show up on the Keycloak's providers page on the admin panel:
However, the factory's create method never gets invoked. And my custom group storage provider never comes into play. How can I enable this custom provider?
Update:
I also updated my Dockerfile's entrypoint to enable and use the extension. But I'm not sure I am feeding the correct information to the kc.sh build command.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have created a custom
GroupStorageProviderFactoryand an accompanyingGroupStorageProviderfor Keycloak's Docker image (quay.io/keycloak/keycloak:18.0.0) version18.0.0as below:I even went overboard to set
enabledproperties for it, but it should not have been necessary as I have a few other custom providers which are all enabled and work by default. This particular provider does show up on the Keycloak'sproviderspage on the admin panel:However, the factory's
createmethod never gets invoked. And my custom group storage provider never comes into play. How can I enable this custom provider?Update:
I also updated my Dockerfile's
entrypointto enable and use the extension. But I'm not sure I am feeding the correct information to thekc.sh buildcommand.All reactions
Replies: 1 comment
Uh oh!
There was an error while loading. Please reload this page.
@shayanarm You should create an component model record to your provider on postInit hook. You need to create one for each realm you want to Enable it.
All reactions