Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
385 views
in Technique[技术] by (71.8m points)

authentication - How can I use Laravel Sanctum in a distributed system?

I need to use Laravel Sanctum in a distributed system, for this case, I have 3 participants:

  1. The user
  2. The API server
  3. 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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...