cancel
Showing results for 
Search instead for 
Did you mean: 

How to login through REST API endpoint and magento website on web browser in a single flow?

How to login through REST API endpoint and magento website on web browser in a single flow?

Hi,

I am using Magento as a headless CMS application and building my own frontend UI and backend application. The intention is to handle customer authentication, product listing and cart management through REST API endpoints provided on https://developer.adobe.com/commerce/webapi/rest/quick-reference/ on my own custom storefront, while...

 

I am looking for solutions (or customizations) to support a workflow where the customers only have to log in once.

Please kindly advise if 
1) Am I able to use set the PHPSESSID cookie from my own application after retrieving the customer token
2) Are there customizations available on Magento to allow me to automatically log customers in once they are redirected to the website on the browser
3) Are there any other possible flows that you recommend such that I can provide customer authentication on both my own platform and magento site through a single log in?

Would appreciate if you can point me to any resources as well. Thank you.

I have come up with some possible flows based on the links I have found:

Magento Customisation (Auto-login with maybe customer token?)

https://magento.stackexchange.com/questions/270938/magento-2-auto-login-with-specific-url

Magento Storefront Login (Set cookie, redirect to platform, call platform API)

https://community.magento.com/t5/Magento-2-x-Programming/Custom-Login-from-external-website/m-p/8137...

https://community.magento.com/t5/Magento-2-x-Programming/Conditional-redirect-after-login/m-p/66015