SSO withh KeyCloak from FrontEnd app with Liferay 7.4 as Headless CMS

thumbnail
Aritz Galdos, modified 2 Years ago. Expert Posts: 416 Join Date: 5/15/07 Recent Posts

Hello dear friends of the community

 

This is the scenario. I have a Liferay 7.4 CE configured to log in with KeyCloak. At this point every thing is fine. I can create a user in KC and it is imported into LR seamlessly.

On the other hand, I am developing a FrontEnd app (Python + Flask) which consumes Liferay's HeadLess API.

I can log-in in the front-end app with KC but if I have never logged this user in Liferay, It has never been imported into LR before from KC. So, even if I log the user in the FrontEnd app against KC, I am not able to get data with the headless API as far as this user has not been imported into LR.

How could I trigger the propagation of the user from KC to LR when I sign-in in the FrontEnd app?

I hoped it would be imported when making the first request to the HeadLess API with the JWT token.

thumbnail
Zsigmond Rab, modified 2 Years ago. Liferay Master Posts: 764 Join Date: 1/5/10 Recent Posts

Hi Aritz,

You should have the user authenticate against the portal instead of KC. The import can happen only in this case, I believe. At least without further customization.

Regards,