Read this part.
API Auth with different Domains
Hi guys
I use Laravel Sanctum's SPA-Authentication in various projects for authenticating the frontend to the API:
api.mydomain.com / mydomain.com
I am aware that I can only use this if I use the same domain. Now I am working in a project where the API has a completely different domain and has to authenticate various frontends to this API.
I solve this via Sanctum AuthTokens and store them in the frontend localStorage at the moment / send them via frontend/axios as Bearer Token. This works, but I am aware that localStorage is probably not the most secure solution. Are there better options (with or without Sanctum) or does Sanctum do anything in the background so this would not be a security issue?
Thanks for all your inputs, Fabian
Please or to participate in this conversation.