After many hours reading, and trial and error it looks like I have to ask a question.
Inside my web app I have written this:
var amazonAccessToken = ""; (function (d) { var a = d.createElement('script'); a.type = 'text/javascript'; a.async = true; a.id = 'amazon-login-sdk'; a.src = 'https://assets.loginwithamazon.com/sdk/na/login1.js'; d.getElementById('amazon-root').appendChild(a); })(document); view.querySelector('#LoginWithAmazon').addEventListener('click', function () { var tokenResponse = amazon.Login.retrieveToken(); if (tokenResponse) { alert("Cached Access Token: " + tokenResponse.access_token); } else { var options = { scope: 'profile', response_type: 'code', pkce: true }; amazon.Login.authorize(options, function (response) { response.onComplete = function (r) { amazon.Login.retrieveToken(r.code, function (res) { alert('Access Token: ' + res.access_token); amazonAccessToken = res.access_token; }); }; }); } });
Each and every time I finish my login, and allow access to my Web App, the dialog goes blank, and when I inspectElement it says:
Uncaught DOMException: Blocked a frame with origin "https://na.account.amazon.com" from accessing a cross-origin frame.
Also, the moment the login dialog opens the web page redirects.
Why does it do this?
How do I stop the page from redirecting, and get the authorization token, so I can create an AccessToken.
W