I want to bind Akeneo 6 Community Edition Events API to a Laravel application, making this latter able to act on the creation of an Akeneo product within Akeneo, for example. In other words, when a user creates a product in Akeneo, Akeneo sends a message to Laravel.
So I've followed this doc: https://help.akeneo.com/pim/serenity/articles/manage-event-subscription.html#activate which says to create a Destination Flow Connection, and then to activate the Events subscription within. Then I have to type the URL of Laravel that will receive the message sent by Akeneo in the Akeneo field URL. Then I can click on the button "TEST" in Akeneo and each time it shows an error "This url is not allowed." .
After having created a POST
Laravel route named receive_akeneo_events
, I've tried to type the following URL:
http://localhost:80/receive_akeneo_events
http://laravel.test:80/receive_akeneo_events (after having added laravel.test
as an entry in my /etc/hosts
at the same line than localhost
)
The same URLs without indicating the port and/or The same URLs in HTTPS.
None works. "This url is not allowed." is still displayed for each of these URLs.
Is it a Laravel problem, i.e.: should this route not be POST
or should it be configured to return a particular HTTP code, since it's the target of an events triggering system (the one of Akeneo)?
Or is it an Akeneo problem or just a bad URL format?
Finally I modified the code of Akeneo CE by removing the exclusion of localhost in a PHP Array called BLACKCLIST and by removing the condition that excludes IP from Private ranges. Both modifications were done in the adequat Symfony validator's script caller.
Moreover, of course I've also done something about Laravel route's CSRF protection, see the Laravel doc to know what: https://laravel.com/docs/9.x/csrf .
Now it works.