I am building an application from scratch which has 2 main parts
A Laravel server - Which will serve HTML pages by querying an API (Preferably no DB interaction)
A Lumen Server - Which will be the API being queried (DB interaction goes here)
Now I need to log in a user.
I can send username and password from laravel server to the lumen API and get a token back (I think it's the way, correct me if I am wrong).
After that what should I do to make the user logged in IN the Laravel server?
Keep the token in session with some key?
How do I make this work with the Auth::user() functionality in the Laravel Server?
Generally you can communicate with other services (in your case your Lumen server) via a Http Client. For example you can use GuzzleHttp to make a get, post, delete request to your api.
Then you can just move the DB and logic to the Lumen server and ask for authentication via GuzzleHttp. On the other side you'll store the session if the API responds with true for example. It's fairly complex and unless you have a very good reason to do so, just stick to the basics :)