c# - Stuck in fetching Tokens from ebay -
using c# mvc 5. problem occuring after hosting app in iis 8.
when view page loads, loads anchor(get token) redirects ebay sign in page runame , session name(runame & sessionid loaded in controller , passed via viewbag , bound anchor tag click event).
in controller:
apicontext.signinurl = "https://signin.sandbox.ebay.com/ws/ebayisapi.dll?signin&runame=" + apicontext.runame + "&sessid=" + _sessionid; viewbag.sign = apicontext.signinurl; viewbag.sessionid = _sessionid;
in view :
$("#ebaysignin").click(function () { var childurl = "@viewbag.sign"; sessionid = "@viewbag.sessionid"; alert(sessionid); var timer = setinterval(checkchild, 500); var isclosed = false; function checkchild() { if (child.closed) { clearinterval(timer); var url = '@url.action("accebayfinalreturn", "settings")'; $.ajax({ url: url, type: 'post', data: json.stringify({ sessionids: sessionid }), datatype: 'json', contenttype: 'application/json', success: function (data) { alert('succ'); }, error: function (data) { alert('error.'); } }); } } });
the sign in page loads in child window correctly.
after "i agree" in ebay consent form (after sign in) window closed.
in main window catch event of closing child window , send sessionid view controller through ajax(code given above). in controller call fetchtoken apicontext , valid sessionid.
try { fetchtokencall ftc = new fetchtokencall(apicontext); _token = ftc.fetchtoken(_sessionid); return _token; } catch (exception) { return null; }
but unfortunately fetchtoken returns nothing. how solve it?
Comments
Post a Comment