I plan on developing a microservice E-Commerce system as proof of concept. The architecture consists of 3 components:
a javascript based single page application, which sends AJAX requests to
a server (API Gateway) with a REST API which feeds JSON data received by calling other services
3 services: CatalogProvider, CustomersProvider, CheckoutProvider
For now the services all are API endpoints of a Magento Shopsystem.
When I try to log in a user into they Magento system by sending a request to the REST Api obviously the server doesn't remember the session when sending the next request.
Also I handle the shopping cart on the server side with Magento and add/update/remove items by REST Api calls. Here, also the added items get lost when sending the next request as the session got lost.
So my question is:
What are possible approaches to solve issues regarding session handling in a microservice architecture?
I suggest that you look at token based authentication.
In addition, JSON Web tokens could also be of interest to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With