Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sessions in a Microservice architecture for an E-Commerce system

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?

like image 915
Rouzbeh Avatar asked Feb 19 '15 13:02

Rouzbeh


1 Answers

I suggest that you look at token based authentication.

In addition, JSON Web tokens could also be of interest to you.

like image 186
VRPF Avatar answered Nov 10 '22 21:11

VRPF