I finally got the solution. Indeed it was the configuration of the services in GeoServer, the correct configuration in the image:
Thanks for the help, Lorenzo.
However, now I have another problem. And I need to give access to some data when accessing without MapStore/GeoServer authentication. In GeoServer I have everything with access to any role, both in layers and in services. But I think there must be some kind of access so that shared maps can be accessed without authenticating to the MapStore interfaces. Now I'm totally baffled.