bbindreiter / node-red-contrib-alexa-remote2-applestrudel

Node-Red Nodes for interacting with Alexa
https://flows.nodered.org/node/node-red-contrib-alexa-remote2-applestrudel
MIT License
75 stars 20 forks source link

Proxy page has no login "Looking for something else? Go to the previous version" #116

Closed gregorykau closed 1 year ago

gregorykau commented 1 year ago

image

This may not be an issue as such, and might just be down to me misunderstanding the initialisation parameters, but I can't get the proxy page to return anything other than this screen. I can't login here to have the cookies retrieved.

Service host: alexa.amazon.com.au Page: amazon.com.au

Is this a known issue?

I am using 5.0.25.

Thanks!

bbindreiter commented 1 year ago

Not yet. Thanks for reporting. What happens when you scan and log in via the app? I presume the page should then automatically refresh and the cookie should be picked up.

gregorykau commented 1 year ago

Unfortunately not, the qr is just a link to "https://alexa.amazon.com/spa/index.html#v2/home", and is not associated with the page request.

https://alexa.amazon.com/spa/index.html Redirects to a login page as expected. But I can't get to this page from the proxy to perform the login which can then (I assume) capture the cookie.

bbindreiter commented 1 year ago

Thank you, got it.

Could someone with a AU service host confirm the problem (backup your cookie file first so you can go back to being logged in)?

ArekKubacki commented 1 year ago

The same on amazon.com. No chance to log in.

bbindreiter commented 1 year ago

Alright. having the same problem now as well. Should be just a redirect/or different landing page url, I will debug it tonight.

gregorykau commented 1 year ago

I haven't delved much into alexa-remote2 as of yet, but as a quick personal hack...

alexa-cookie2/lib/proxy.js Setting Line 138 to... _options.baseAmazonPag = 'amazon.com.au/spa/index.html'

Gets past the issue. Don't know about the intermediary layers of how this all comes together.

bbindreiter commented 1 year ago

Yes 👍, I will add a PR on alexa-cookie to add /spa/index.html to the base url. This lib is used in alexa-remote which is used in applestrudel.

gregorykau commented 1 year ago

Gotcha! I should've raised the issue there, but posted on this repository before I bothered to look into it properly. Laziness I'm afraid, hence the want to automate in the first place :D

ArekKubacki commented 1 year ago

@gregorykau Does the change you provided work? It throws an error for me.

https://alexa.amazon.com/spa/index.html/ HTTP ERROR 404

I think the problem is in the "/" at the end but I can't get rid of it. Are you able to send your alexa-cookie2/lib/proxy.js file? Because in mine in the given line there is something completely different.

bbindreiter commented 1 year ago

It's not that easy. I hacked in the /spa/index.html appendix into the cookie library but then the proxy, unlike when opening it in the browser directly, gets a cloudfront error back. I think we need @Apollon77

gregorykau commented 1 year ago

@gregorykau Does the change you provided work? It throws an error for me.

https://alexa.amazon.com/spa/index.html/ HTTP ERROR 404

I think the problem is in the "/" at the end but I can't get rid of it. Are you able to send your alexa-cookie2/lib/proxy.js file? Because in mine in the given line there is something completely different.

This is working for me currently.

"version": "4.1.3", alexa-cookie2\lib\proxy.js Starting at line 137

    let proxyCookies = '';

    _options.baseAmazonPag = 'amazon.com.au/spa/index.html';

    // proxy middleware options
    const optionsAlexa = {
ArekKubacki commented 1 year ago

It is not working for me :(

bbindreiter commented 1 year ago

Here's a workaround that has always worked for me so far:

1.) Clear all your cookies from alexa.amazon.com

2.) Restart node-red so you get the open http://your-hostname:3456 message

3.) Open a new tab and go to https://alexa.amazon.com/spa/index.html -> login with your credentials

4.) Open a new tab and open the link that node-red shows -> If you get the page shown as below click on the "Looking for something else?" link in the top left.

image

5.) Login happens automatically, cookie is fetched and once you see http://your-hostname:3456/cookie-success in the URL bar you're all set and can go back to node red.

Apollon77 commented 1 year ago

Can noone provide me with a fukll debug log of that? Normally The / call on the proxy port should directly forward to the Login mask from amazon and not to that alexa.amazon.de page, thats why I would like to understand what happens here

bbindreiter commented 1 year ago

Email sent. Thank you!

dhodgesnvl commented 1 year ago

Thanks for your work! I've been working on it for a while but nothing changes. Which flavor of the node-red-alexa should I be working with? TIA Doc

bbindreiter commented 1 year ago

Thanks for your work! I've been working on it for a while but nothing changes. Which flavor of the node-red-alexa should I be working with? TIA Doc

https://github.com/Apollon77/alexa-remote and subsequently this uses https://github.com/Apollon77/alexa-cookie.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.