Page 1 of 1

How to pass a parameter in URL to auto-login?

Posted: Sun Mar 17, 2019 6:38 pm
by gamora77
Opencart 2.1.0.2

My main website (made in Joomla) has a custom login for a user with username/password. When clicking on 'buy' from the front page I would like OpenCart to open with this username/pass already 'logged in' to OpenCart. How can I achieve this? I need to pass-on this username when making a purchase (this I have already solved with a custom_field).

I'm thinking I'm probably not the first one with this issue. Can someone point me in the direction to go? I can code but not particularly familiar with OpenCart.

Re: How to pass a parameter in URL to auto-login?

Posted: Sun Mar 17, 2019 9:36 pm
by straightlight
Auto-login is not recommended. Better to use an API for these transactions since password algorithms are handled differently between frameworks on anyhow as auto-login can opened unexpected doors through the browser when using cross-websites. Opencart 2.3.0.2 and above does support the use of API with backward compatibility tokens.

Followed is an example with outside logins on how to use local APIs with Opencart: viewtopic.php?f=202&t=203512&p=720446#p720446