Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lbottoni's avatar

jwt ajax socialite with 2 hosts

Hi, i want understand the best way to implement a app mobile.

scenario with 2 host

  • i have hostserver.localhost where i write laravel code with: laravel 5.4, jwt and socialite (here i dispacth only api restful)

  • i have a separate host clientapp.localhost where i write in js.

now i call from clientapp.localhost => hostserver.localhost/auth/facebook, the response is the url (or html code ), the user write the username and password in facebook form and after authetication i have my problem

facebook after authentication redirect the call to hostserver.localhost/auth/facebook/callback, where i print my token authenticated, but how can i get this token from my js in clientapp.localhost ????

myabe i mistake the approach.

0 likes
0 replies

Please or to participate in this conversation.