Trying to create an extension where I need to redirect the user (merchant) to a third party payment website where he will log in and give authorization (OAuth 2.0) to handle payments. Once he does that, he will be redirected to the REDIRECT_URI I supplied.
Currently, I'm supplying REDIRECT_URI with my extension edit page url followed by his current user_token.. something like this:
https://mydomain.com/admin/index.php?ro ... 6Def789Ghi
The third party payment website appends an authorization code to my REDIRECT_URI, making it something like:
https://mydomain.com/admin/index.php?ro ... =123456789
(Note the '?' before authorization code).
Here is the problem:
When the new formed URL is loaded, it asks the user for Login again because user_token is '123Abc456Def789Ghi?authorization_code=123456789' (?auth.. is appended to user token).
I was able to fix it by editing the admin/controller/common/header.php file and 'fixing' the query parameters. All is working fine buuuut... Since I want this to be an extension, I need to find another way of doing this that doesn't require me to edit anything outside of my extension files.
Since it uses OAuth 2.0 I'm pretty sure someone has already came up with this problem and was hoping they could tell me how they solved it
