question

DevGuy avatar image
DevGuy asked

Why is my WebView blank after attempting LWA login?

I have a WebView in my Android app which goes through a flow in which a user may login using a LWA button. The flow works fine in an ordinary browser (on Android and elsewhere), but for some reason, after attempting to login in the WebView, it's never redirected back to our own flow.

chromium: [INFO:CONSOLE(216)] "Uncaught Error: xdc error: no proxy amazon-proxy-https-api_cdn_amazon_com", source: https://na.account.amazon.com/ap/oa?.......<lots of URL stuff here>

I've found very little about this error, most of it talking about whitelisting the app or similar. However, it all works fine in a regular browser, so that doesn't seem like it would be the trouble. I've attached to the WebView using the Chrome dev tools, and the app is still looking at an Amazon page. No redirect back to our own pages has successfully occurred yet.

How can I get this working?

login with amazonandroid
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi DevGuy,

You may be trying to open your website (integrated with Login with Amazon JavaScript SDK) within the WebView that is using LwA popup flow which is known to not work within WebViews. The current alternative is to use redirect flow (specify 'popup' as false in the LwA authorize call). Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rogerdpack avatar image
rogerdpack answered

Assuming you're using a popup, see this: https://stackoverflow.com/q/12648099/32453

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.