Setup custom federation which extends ldap provider.
Thank you so much for the fast reply!
On the following link there is a module that works as an example of what I
was trying to accomplish and its jar:
To make it running, I copied the jar
I also appended to standalone/configuration/standalone.xml:
Then, I restarted keycloak. If one goes to "User Federation" and creates a
custom ldap the following form is displayed (see image1.pgn, see link
above, its on the root folder), where all the labels are missing besides
the one we created (Display Name, on the bottom) and some buttons like
"Test connection" are missing.
Thoughts on the question:
- on the CustomLDAPStorageProviderFactory we can override
getConfigProperties() and add a new property. By calling
label()/defaultValue()/helpText() we can have the input field full
configured. On the other hand, in the parent LDAPStorageProviderFactory,
most of the defined properties do not have label/defaultValue/helpText
specified, and so, most input fields are empty (no label).
To have the input fields fully functional I was thinking two ways:
1) overriding all properties from LDAPStorageProviderFactory, and specify
one by one their content. But the buttons like "Test Connection" would
still be missing.
2) checking how the input form was created for LDAPStorageProviderFactory,
it uses user-storage-ldap.html. Which is being mapped from app.js.
Question: if we would use user-storage-ldap.html, how to map it to our
custom provider without changing the contents of app.js.
Question: how to extend user-storage-ldap.html for that attribute that we
added initially without having to copy the whole user-storage-ldap.html.
(Once again Im new to keycloak, and do not have experience with Freemarker).
Thank you so much for your support,
On Fri, Aug 23, 2019 at 12:54 PM Jan Lieskovsky <jlieskov(a)redhat.com> wrote:
On Thu, Aug 22, 2019 at 2:15 PM David VS <david.vsaraiva(a)gmail.com> wrote:
> Setup custom federation which extends ldap provider.
> Question: What is the proper way to extend the ldap federation while
> one more configuration input? (without changing internal keycloak files)
> I followed the steps in
> and specify my own provider and providerFactory,
> In admin console, when trying to create the federation "custom-ldap", most
> of the input fields do not have a label and some buttons like "Test
> connection" are missing. The configuration property that I added and
> customized has label/default value/tooltip.
Hard to say without looking at the specific code, trying to implement this.
But I would assume, those fields aren't available because the custom
LDAP provider doesn't implement the underlying interface methods, that
are actually responsible for performing the action, when particular button
What happens, if you override the specific methods from the default LDAP
provider, responsible for accessing these fields, and point them back
to the default implementation (e.g. by calling super() with the same args /
params within the overridden interface method)?
> If it is not possible to extend the form, is there an easy way how to
> inherit the same UI form from the ldap federation page in my extension?
Is the issue, that you can't see the fields, newly introduced by your
federation provider, or that some fields from the default screen aren't
usable upon the implementation of that a provider? Or both?
> (Im new to keycloak, and do not have experience with Freemarker).
> Thank you so much for your support,