xWiki + Keycloak + Spring Boot = Error 401 Access denied in edit mode

Hello everyone :smiley:

I want to thank all developers from XWiki and all contributors for providing this awesome platform.

I have my Wiki deployed on a server with HTTP and it uses Keycloak (deployed on another server with HTTPS protocol) as a service for authentication.

Apart from that, I am developing a Java Spring API to make calls to the REST API that xWiki has by default, so I can create pages and objects in my Wiki using only my Java Spring API.

The problem is that when I make requests from my Java API to the Wiki, I always get an error:

401
com.xpn.xwiki.XWikiException: Error number 9001 in 9: Access denied in edit mode on document xwiki:Content.item.KeyCloak

I have been testing and I have deployed another Wiki, but this one does not use Keycloak, it only has the authentication service by default, when calling from my Java Spring API this Wiki works without problems.

Is there any documentation for my Java API to authenticate correctly with the Wiki using Keycloak?
Any advice?

Any information would be greatly appreciated,
Thank you very much