Seller Central
Seller Forums

Amazon Seller Forums » Login With Amazon » Login With Amazon Developers

Thread: Login with Amazon: AJAX instead of redcirect
This question is answered.


Permlink Replies: 2 - Pages: 1 - Last Post: 08 Jun, 2017 9:49 PM by: Solve Calc, Inc
Solve Calc, Inc

Posts: 2
Registered: 08 Jun, 17 5:27 AM
Posted on: 07 Jun, 2017 10:29 PM  
Click to report abuse...   Click to reply to this thread Reply
In step 3 of step 3 of http://login.amazon.com/website

document.getElementById('LoginWithAmazon').onclick = function() {
options = { scope : 'profile' };
amazon.Login.authorize(options, 'https://www.example.com/handle_login.php');
return false;
};

the current way is via a REDIRECT. after login, the user is redirected to example.com/handle_login.php

I want to do something different -- on login, I want to do an AJAX call (so user stays on the current page).

Is this ossible?

THanks! View the reply Solve Calc, Inc selected as correct

Is this a helpful question? Yes 0   No
2 Replies
Sort replies by:

Solve Calc, Inc selected this reply as correct

View original question

Rahul@SellerSup...

Posts: 7
Registered: 28 Mar, 15 1:00 AM
Posted on: 08 Jun, 2017 11:17 AM   in response to: Solve Calc, Inc in response to: Solve Calc, Inc  
Click to report abuse...   Click to reply to this thread Reply
Hi

Yes that is possible. You can pass a javascript function to the second parameter in the authorize call.
Pasting an excerpt from page 21 of Developer Guide PDF on http://login.amazon.com/website.
"The second parameter is either a JavaScript function to handle the authorization response, or a redirect URI to another page". Please consult our Developer guide and let us know if you have more questions.

Thanks
Rahul
Login with Amazon
Was this reply helpful? Yes 1   No 0
Solve Calc, Inc

Posts: 2
Registered: 08 Jun, 17 5:27 AM
Posted on: 08 Jun, 2017 9:49 PM   in response to: Rahul@SellerSup... in response to: Rahul@SellerSup...  
Click to report abuse...   Click to reply to this thread Reply
Precisely the information I needed.
Thanks!
Was this reply helpful? Yes 0   No 0