As far as I understand, the generally accepted way to allow other websites to do anything along these lines is by making use of OAuth2.
Have you taken a look at Passport?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I understand that this is quite a broad and large question and so I will try to break it down effectively. I am also hoping for answers that would be both robust and secure. Here goes:
I would like to add a login and registration to my API from within another website, that I do not own. I understand that they would be embedding some javascript but I am assuming that I would need to provide the login as an iframe?.. as I do not want to expose my services password to the page in which the login is embedded. (Is there a better solution?)
Once the user has logged in, I would like to consume my API from within that page. How would one securely store and access any token information?
Perhaps consider this similar to a comments system where a user might inject into their own website. Any help to accomplish something like that with Laravel would be very useful. Many thanks in advance.
Please or to participate in this conversation.