Answer the question
In order to leave comments, you need to log in
What is the easiest way to move to microservice architecture?
And so, there is a back-end written in Laravel that uses the Laravel Sanctum package to issue authentication tokens. That is, the front end sends a request and receives a cookie with a key in response. But now I need to hook up Node.js as a microservice that will be responsible for a separate feature in the application. And this is all fine, but you need to somehow check whether the user is authorized or not. Is there any way to integrate Laravel Sanctum authentication with Node.js? Where is the best place to look? Towards OAuth2? Or somehow store the tokens in the database and run after them in the database with each request?
I assume that it is necessary to transfer authorization to some separate microservice through which all requests will pass, but I'm not at all sure, since I have never worked with microservices.
I would like to hear the opinion of experienced people.
Answer the question
In order to leave comments, you need to log in
If something is not transmitted, then it is not necessary to run to the database after it, and if something is not encrypted, then it does not need to be decrypted. Create a trusted network within which one service will transfer only the user id to another.
The simplest solution is to cover the node.js proxy from laravel. It's not clear, why the hell gave up node js in a laravel project. What specific us case?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question