Obtaining eBay OAuth access code after user clicks
So, I am trying to obtain the eBay OAuth access_token into my React app and have gotten stuck because I don't know how to get that back to my app once the access_token comes through.
I have created a page in React with a button meant to display an eBay OAuth link after user clicks.
However, I am doing all this testing from my local machine, namely localhost:3000 (frontend) and localhost:8000 (express backend).
And to bypass the https requirement by ebay (I am using http://localhost:8000 which is a no-no for the eBay redirect url), I am using ngrok to produce links that look like https://8e37hhnc176c.ngrok.io/ which go in the ebay RuName settings.
All is well and good until I have to obtain the access_token because by clicking the link created by clicking that initial button, it opens a new page that I cannot access the localstorage or cookie for. I am at a loss as to how to get this back to my redux React frontend app. I thought about having it write this token to a temp file on the server but I don't like that potential security risk.
How can I return the access_code returned from eBay to my app?
Attempts:
- Tried res.cookie by returning a view page which ultimately showed me that wouldn't work because it's a new tab that opens and even tho you could put a cookie in, it just cannot be seen by my app :(
- Tried res.send() with res.cookie but that STILL produces another unrelated tab
from Recent Questions - Stack Overflow https://ift.tt/3aXReOC
https://ift.tt/eA8V8J
Comments
Post a Comment