# Keycloak IdmIdentityService

**URL:** <https://forum.flowable.org/t/keycloak-idmidentityservice/5942>\
**Category:** Flowable Engine\
**Created:** [May 4, 2020, 12:39am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942 "2020-05-04T00:39:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nouhouari](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/nouhouari/32/1786_2.png) [@nouhouari](https://forum.flowable.org/u/nouhouari)\
**Post date:** [May 4, 2020, 12:39am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/1 "2020-05-04T00:39:42Z")

</div>

Hi,  
I’m writing a Spring boot application using Keycloak for Authorization/Authentication and managed to integrate Flowable successfully.  
As I understand, the users are retrieved from the flowable **IdmIdentityService** and I would like to create a custom **KeycloakIdmIdentityService** that will read the users and groups from **Keycloak**.

```
public class KeycloakIdmIdentityService implements IdmIdentityService {
...
}

```

This will avoid to duplicate users data.  
To get the users and roles from Keycloak, I setup the **keycloak-admin-client** library and manage to query the users.

To tell Flowable to use my custom class, I’m injecting an instance of **KeycloakIdmIdentityService** into the **IdmEngineConfiguration**

```
@Bean

```

@Bean  
@Primary  
IdmIdentityService getKeycloakIdentityService( KeycloakAdminService keycloakAdminService) {  
return new KeycloakIdmIdentityService(keycloakAdminService);  
};

Dear Flowable developers, I’m just wondering if it’s the best approach and if anybody already implement such custom **IdmIdentityService**.

Thanks

---

<div class="post-metadata">

**Author:** ![douglascrp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/douglascrp/32/306_2.png) [@douglascrp](https://forum.flowable.org/u/douglascrp)\
**Post date:** [May 4, 2020, 12:00pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/2 "2020-05-04T12:00:27Z")

</div>

Hello

Please, read the following thread, and it seems the mentioned links are useful:

> [@How To: Keycloak, Flowable and OpenLDAP](https://forum.flowable.org/t/how-to-keycloak-flowable-and-openldap/5163):
>
> Not so long ago I wrote a series of posts about Flowable: [Getting started with Flowable](https://robferguson.org/blog/2018/12/10/getting-started-with-flowable/)[Flowable’s REST API - Part 1](https://robferguson.org/blog/2018/12/24/flowable-rest-api-part-1/)[Flowable’s REST API - Part 2](https://robferguson.org/blog/2019/01/02/flowable-rest-api-part-2/)[Flowable’s REST API - Part 3](https://robferguson.org/blog/2019/01/03/flowable-rest-api-part-3/)[How To: Build Flowable](https://robferguson.org/blog/2019/01/05/how-to-build-flowable/)[How To: Flowable and LDAP](https://robferguson.org/blog/2019/01/28/how-to-flowable-and-ldap/) And recently I wrote about [Getting started with Keycloak](https://robferguson.org/blog/2019/12/24/getting-started-with-keycloak/), [Angular, OpenID Connect and Keycloak](https://robferguson.org/blog/2019/12/29/angular-openid-connect-keycloak/) and [Angular, OAuth 2.0 and Keycloak](https://robferguson.org/blog/2019/12/31/angular-oauth2-keycloak/). In this [post](https://robferguson.org/blog/2020/01/03/keycloak-flowable-and-openldap/), I’ll walk you through the steps I followed to get Keycloak to work with Flowable and OpenLDAP.

---

<div class="post-metadata">

**Author:** ![Robinyo](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@Robinyo](https://forum.flowable.org/u/Robinyo)\
**Post date:** [May 4, 2020, 7:04pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/3 "2020-05-04T19:04:40Z")

</div>

> [@nouhouari](#):
>
> managed to integrate Flowable successfully

Did you use one of the Flowable Spring Boot [starters](https://github.com/flowable/flowable-engine/tree/master/modules/flowable-spring-boot/flowable-spring-boot-starters) to embed one of engines (i.e., BPMN, DMN and CMMN)?

See: [Flowable OAuth2 Resource Server](https://robferguson.org/blog/2020/02/05/flowable-oauth2-resource-server/)

---

<div class="post-metadata">

**Author:** ![selkhlifi](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/selkhlifi/32/1816_2.png) [@selkhlifi](https://forum.flowable.org/u/selkhlifi)\
**Post date:** [May 4, 2020, 11:40pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/4 "2020-05-04T23:40:33Z")

</div>

Based on the documentation [https://flowable.com/open-source/docs/bpmn/ch12-IDM/](https://flowable.com/open-source/docs/bpmn/ch12-IDM/) I think you should follow how the LDAP identity service was integrated. This is by creating a custom EngineConfigurationConfigurer

Check out the source code of two classes to have an idea about that

org.flowable.spring.boot.ldap.FlowableLdapAutoConfiguration  
org.flowable.ldap.LDAPIdentityServiceImpl.java

---

<div class="post-metadata">

**Author:** ![nouhouari](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/nouhouari/32/1786_2.png) [@nouhouari](https://forum.flowable.org/u/nouhouari)\
**Post date:** [May 5, 2020, 12:34am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/5 "2020-05-05T00:34:15Z")

</div>

Yes, I’m using Flowable Spring-Boot starter.

---

<div class="post-metadata">

**Author:** ![nouhouari](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/nouhouari/32/1786_2.png) [@nouhouari](https://forum.flowable.org/u/nouhouari)\
**Post date:** [May 5, 2020, 12:38am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/6 "2020-05-05T00:38:34Z")

</div>

Hi Douglas,  
Thank you very much for sharing your article. Really interesting.  
Does it mean that to use Flowable with Keycloak, I need to use OpenLDAP to get the user from it ?

Thanks

---

<div class="post-metadata">

**Author:** ![Robinyo](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@Robinyo](https://forum.flowable.org/u/Robinyo)\
**Post date:** [May 5, 2020, 1:24am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/7 "2020-05-05T01:24:59Z")

</div>

> [@nouhouari](#):
>
> Yes, I’m using Flowable Spring-Boot starter.

Then you don’t need to use the Flowable IDM you can store your user’s credentials in a directory server (e.g. OpenLDAP or AD).

For example: [Keycloak, Flowable and OpenLDAP](https://robferguson.org/blog/2020/01/03/keycloak-flowable-and-openldap/)

---

<div class="post-metadata">

**Author:** ![nouhouari](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/nouhouari/32/1786_2.png) [@nouhouari](https://forum.flowable.org/u/nouhouari)\
**Post date:** [May 10, 2020, 8:24am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/8 "2020-05-10T08:24:40Z")

</div>

Thanks for you answers,  
But my question is about using Keycloak **alone** as “user repository”.  
Is it possible to use Flowable with Keycloak and without LDAP?

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [May 11, 2020, 2:31pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/9 "2020-05-11T14:31:57Z")

</div>

Hey @nouhouari,

Everything is possible with some code. You will need to provide your own implementation of the `IdmIdentityService`. Have a look at the [`LDAPIdentityServiceImpl`](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-ldap/src/main/java/org/flowable/ldap/LDAPIdentityServiceImpl.java) to see what needs to be done.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![humaruis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/humaruis/32/2476_2.png) [@humaruis](https://forum.flowable.org/u/humaruis)\
**Post date:** [September 13, 2021, 2:28pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/10 "2021-09-13T14:28:22Z")

</div>

Hi Nouhouari,

I encountered same problem about using keycloak for authentication & anthorization integrate with flowlable, will appreciated it if you can share me with your spring boot application for study.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![NeerajGupta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/neerajgupta/32/2652_2.png) [@NeerajGupta](https://forum.flowable.org/u/NeerajGupta)\
**Post date:** [December 8, 2021, 5:17pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/11 "2021-12-08T17:17:11Z")

</div>

Hi, I am looking for flowable-rest integration with Keycloak for authentication & fetching user and groups. Its being one of the much needed feature, is there any github repo containing in-progress work for the same that I can refer?  
Thanks in advance. Best Regards  
Neeraj Gupta

---

<div class="post-metadata">

**Author:** ![hberrayana](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/hberrayana/32/2670_2.png) [@hberrayana](https://forum.flowable.org/u/hberrayana)\
**Post date:** [December 23, 2021, 2:49pm UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/12 "2021-12-23T14:49:35Z")

</div>

Yes, I’m trying to build something and publish it to the crowd in the next weeks.  
This is something that I’ll work on within the next weeks among other things.

---

<div class="post-metadata">

**Author:** ![santoshmallah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/santoshmallah/32/3343_2.png) [@santoshmallah](https://forum.flowable.org/u/santoshmallah)\
**Post date:** [December 12, 2023, 11:06am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/14 "2023-12-12T11:06:14Z")

</div>

Hello @hberrayana  
If you have implemented this, please send me a detailed approach or sample code.

---

<div class="post-metadata">

**Author:** ![Linkk2000](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/linkk2000/32/3667_2.png) [@Linkk2000](https://forum.flowable.org/u/Linkk2000)\
**Post date:** [March 5, 2025, 7:06am UTC](https://forum.flowable.org/t/keycloak-idmidentityservice/5942/15 "2025-03-05T07:06:36Z")

</div>

Hello, I also have this requirement. May I ask if you have found any way to solve it?
