I need to use Laravel Sanctum in a distributed system, for this case, I have 3 participants:
- The user
- The API server
- The authentication server
The authentication server is only for generate and validate tokens, the API must make the authentication by calling to the authentication server and sending the token in the authorization header of the request. This token it's sent by the user when calling the API (the user had to make a request for a token to the authentication server before)
I want to use Laravel 8 in the API server and also, I want to use Laravel 8 in the authentication server, I know that I can use Laravel Sanctum to handle the API authentication, but it has to be in the same server that the API is in, the middleware auth:sanctum
works by searching the token in the same database that the API is in, but now I need that the middleware search the token in the authentication server who has another Laravel with another database, how can I do that? Do I need to do it manually?
question from:
https://stackoverflow.com/questions/66067845/how-can-i-use-laravel-sanctum-in-a-distributed-system 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…