Git Product home page Git Product logo

alexa-cookie's Introduction

Hello out there 👋

I spent most of my available time, beside family and job, to make IoT easier to use for everyone - using Node.js, TypeScript and JavaScript.

I'm one of the core developers of the smart home automation software ioBroker. Beside working on the central component js-controller I try to maintain over 200 adapters/plugins in the ioBroker Organization and in the Community Adapter Organization together with some other developers. Additionally to this I support the ioBroker project as Project manager for core topics and bigger releases and coordinate the work in the community and communication channels like Forum, Discord and Telegram. With all this work my goal is to deliver best possible quality for the users and community members and make the life easier and more convenient for all ioBroker developers.

One of my current main focus topics is to build, maintain and lead the JavaScript/TypeScript library for the Matter protocol in the official project-chip organization to allow the JavaScript community build devices and controllers for the new Matter smart home standard.

Furthermore I also maintain some own ioBroker adapters and some Libraries to bring IoT protocols into the Node.js world. I always try to develop libraries that are usable by all JS/TS developers out there. E.g. I do maintain projects to interact with Amazon Alexa Devices, Daikin Devices, Daikin Cloud Devices, MBus devices, Meross Devices, Smartmeters and last but not least HomeKit HAP Controller and I also co-maintain and contribute libraries for some other protocols like Coap or Tuya.

If you want to support me, you can:

Apollon77 GitHub stats

alexa-cookie's People

Contributors

apollon77 avatar dependabot-preview[bot] avatar dependabot[bot] avatar gabriele-v avatar hive avatar soef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexa-cookie's Issues

Cognito Accounts

Is your feature request related to a problem? Please describe.
In order to get a token, it requires someones entire amazon account access login.

Describe the solution you'd like
A cookie that is a bit more secure, and dedicated to alexa controls.

Describe alternatives you've considered
Possibly be able to control someones alexa using a cognito user account, or alexa account linking.

Additional context
I am trying to provide a service for alexa users to trigger certain actions on different times everyday, managed by my cloud scheduler. Specifically its to call the muslim athan (call to prayer). Since these times change everyday, users cant just set up routines. I am hoping to build a onestop shop solution to help trigger alexas, and since alexa skills dont allow proactive events to trigger skills or audio, this is potentially the perfect solution.

TLDR: can I use someones cognito account/alexa account linking token to use the alexa remote control shell script?

How to use it with Alexa Remote Node Red?

What is the simplest setup for Node Red - Alexa Remote?

My thinking:

  1. alexa-cookie-cli
  2. crontab with raspberry pi to auto generate cookie save to .txt
  3. setup in node red file path to cookie.txt

The created refresh_token does not work with alexa_remote_control.sh.

Describe the bug

I'm based in the UK. Using windows 11 and Ubuntu to create the refresh token.

I have sucessfully created the refresh_token on Windows and Linux but i get the same problem on both platforms triny to use the refresh token created from the CLI binary tool on both platforms. The refresh token is created successfully, i check it's formatting for extra spaces etc... See below: (not my real token!)

Atnr|EwICIAtIeD15rtIJ3bSpCb02hlUAqWw1GriZbBDPmNrZ4ZWTWaQIFsn6l7KNcAVZ2lTQbtcC6X_WiosJ-yx5wqVqTzloFn0yzmJ1QCkDJy-j-pN4cWaowcmOJGBjXAdgkHAFzDV6gLTzLivCYR1doOt4irDmM4JApiHWE1HEZpIp7XLHZ07aavAK2NaM7QI9lV6UJJTtZHsFzaRPajYK2yxZdZAZZoRVp-qdqI8yFDE057PkfF9F_FfGmNpAvjXqTptuwBCapCzTPUPHUEshkD3CXQml4fHeHYMhlhmh_zeVj39nL1h27-yBqwvB1AI68q3bxdqJ99EEq2uIeCaPOR7DONVh5WI49tZQB71yPJJ-L7iqeFVY0F4bMBMCUUUcMknbXH1

I paste it into refresh_token within the the alexa_remote_control,sh script (including the "Atnr|" bit!)

image

And i get the following errors:

image

I've created the token using the following cli arguments, nothing has worked.

alexa-cookie-cli-linux-64 -p amazon.co.uk -a en-GB -L en-GB
alexa-cookie-cli-linux-64 -p amazon.co.uk -a en-EN -L en-EN
alexa-cookie-cli-linux-64

To Reproduce
Steps to reproduce the behavior:

  1. Create a token
  2. Copy it into the refresh_token variable in the alexa_remote_control.sh script
  3. Run ./alexa_remote_control.sh to get a new token.
  4. See failure message.

Expected behavior
A new token to be created.

Screenshots & Logfiles
See above.

Alexa-cookie v3.2.1 for alexa.amazon.co.jp

Thank you for updateing Alexa-cookie for Japanese Alexa users. I updated alexa-cookie modules on my node-red.
But, node-red could not get alexa-cookie from alexa.amazon.co.jp.

I read source code of v3.2.1, I found new parameter "baseAmazonPage".
But, changing initialUrl and exit condition are needed for alexa.amazon.co.jp.

BR.

Continually prompted for captcha

Continuing conversation from thorsten-gehrig/alexa-remote-control#10 (comment)

I'm using your provided example code:

let Alexa = require('alexa-remote');
let alexa = new Alexa();

/***************************************************************/
// see: https://www.gehrig.info/alexa/Alexa.html
// cookie starts with x-amzn-dat and ends with =" csrf=12345780
let cookie = 'x-amzn-dat.../ /...=" csrf=12345780';

alexa.init({
        cookie: cookie,  // cookie if already known, else can be generated using email/password
        email: '[email protected]', // optional, amazon email for login to get new cookie
        password: 'XXXX', // optional, amazon password for login to get new cookie
        bluetooth: true,
        logger: console.log, // optional
        baseUrl: 'pitangui.amazon.com' // optional, e.g. "pitangui.amazon.com" for amazon.com, default is "layla.amazon.de"
    },
    function (err) {
        if (err) {
            console.log(err);
            return;
        }
        for (let device of this.devices) {
            console.log (device._name);
        }
    }
);

But I continually receive this output:

Error: Captcha needed
    at request (/Users/whowd/Dropbox/Desktop/alexa-remote/node_modules/alexa-cookie/alexa-cookie.js:187:31)
    at IncomingMessage.<anonymous> (/Users/whowd/Dropbox/Desktop/alexa-remote/node_modules/alexa-cookie/alexa-cookie.js:69:33)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

I have tried an incognito Chrome browser with JS disabled and logging into Alexa.Amazon.com. After getting prompted for the captcha, I logon and receive a white screen and then try running the example code again, but still receive the captcha prompt.

I can post the full output of the example script, but wasn't sure if I needed to sanitize any of the encoded or hashed text. Thanks.

New landing page that does not redirect to login page

Describe the bug
The baseAmazonPage does not respond (or redirects) to the alexa login page anymore, Amazon added a new landing page before it. This new landing page, depending on the country, shows a QR code (bbindreiter/node-red-contrib-alexa-remote2-applestrudel#116 first post) or looks slightly different.

For me this new landing page provides a link that opens in a new browser tag due to (target=_blank), thus when clicked the proxy doesn't pick it up. I tried to set the base amazon page to include the path spa/index.html but the proxy then always received a http 404 cloudfront error. When opening it in the browser it worked. It was only a quick and dirty hack so I might have missed something.

If you point me to what needs to be changed I could open up a PR. Thanks!

To Reproduce
Just try to fetch a cookie with amazon.com set as base page.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Create standalone binary to be used in other projects

Other projects like alexa_remote_control.sh or 37_echodevice in FHEM would profit from the proxy implementation, if it could be used as a single binary on Windows/Linux/(possibly OSX).
Instead of re-inventing the wheel, it would make sense to use this well maintained code base. Having a single binary to do the heavy lifting (Proxy, presentation to the user, etc.) allows for fast adoption throughout other applications.

Once the refresh_token has been retrieved - which might as well be off-board - it is sufficient for creating access tokens with little effort and no further user interaction thereafter.

The idea is to supply the main config options on the command-line, e.g.

  • amazonPage
  • baseAmazonPage
  • amazonPageProxyLanguage
  • proxyOwnIp
  • proxyPort
  • proxyListenBind

The result should be output to stdOut as JSON, with the contents of the device registration, containing at least:

  • refresh_token
  • app_name
  • app_version
  • di.sdk.version
  • di.hw.version
  • di.os.name
  • di.os.version
  • package_name
  • platform
  • current_version

According to my testing these items are sufficient to

  1. create access cookies:
POST /ap/exchangetoken/cookies HTTP/1.1
x-amzn-identity-auth-domain: api.amazon.de

requested_token_type=auth_cookies
app_name=Amazon Alexa
app_version=2.2.223830.0
di.sdk.version=6.10.0
domain=www.amazon.de
source_token_type=refresh_token
source_token=Atnr|...
  1. refresh access token:
POST /auth/token HTTP/1.1
x-amzn-identity-auth-domain: api.amazon.de

app_name=ioBroker Alexa2
app_version=2.2.223830.0
di.sdk.version=6.10.0
di.hw.version=iPhone
di.os.name=iOS
di.os.version=11.4.1
package_name=com.amazon.echo
platform=iOS
current_version=6.10.0
requested_token_type=access_token
source_token_type=refresh_token
source_token=Atnr|...

Documentation - how to run this?

Pardon for the noob question, but could you please provide a few notes of documentation on how to get this to run?

I figured out I need to have node.js installed (I have tried versions 16.x and 19.x) and run "node example.js".

Unfortunately, it fails:
/Users/dmitriy.alergant/aws/alexa-cookie-4.1.3/example/example.js:24 formerRegistrationData: { ... } // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too ^ SyntaxError: Unexpected token '}'

Thanks!

I saw your other project alexa-cookie-cli, but prefer not to run unknown binaries.

CSRF value is empty on cookie refresh

I'm receiving a valid cookie just not the csrf.

2019-08-27T14:49:13.220494+00:00 app[web.1]: loginData:  { amazonPage: 'amazon.com',
2019-08-27T14:49:13.220508+00:00 app[web.1]:   csrf: undefined,
2019-08-27T14:49:13.220511+00:00 app[web.1]:   deviceId:
2019-08-27T14:49:13.220514+00:00 app[web.1]:    '655457071046460250781350320567413632507206565623838656668324238223413249564c5635564d32573831',

Amazon Auth Flow Change

I've been using a modified version of this proxy and today noticed that no long works. It just redirects back the primary alexa.amazon.com web page.

Can’t refresh.js work

I can create and store a Alexa cookie with a modified example file and use that to trigger the text to speech interface of Alexa.

Only when a try a modified refresh.js to work, I got the following output:

node alexa_cookie_refresh_1.js
{"loginCookie":"at-main=Atza|IwEBIGhx-S3MokSq97SyBJMq5qKXLwu3hDI3f03c-sErKoo4MVSrTA5ZKazOB2wM651_bcznn_vFEa04mApFtwBklHUYxoGvudMNLMeDGPC4ST050ecoXCgZFD5N90PnZxD87h3bGGHH0QLXMkoN3U7_zN9Cz91sXcfcIKuL1qE50drmQVG-U4KzX4hv9L5nP7yd-MQaukBABOX3HITUs1yiziiXVHf5Tbo2kX9uoQ8KT1ze4riU1a4Kxkf3gDY2-fqS67pCbS9Rv24hG-CPg_pbVXqjLqk8-5gBFgJ2yIA5WZprEk3OVG5iWHN60yJAOr6THRbH1vsRXpIkafmjZ7BzojXq2uLl5s9ahxWmj8xpJpNjBwPWH5q1XxbfCkIU0kF4SnbiXnHChKS41OQacgAsXIUY; sess-at-main="kkCsG9UXYb+1KonAWMQZpTEwv+TRI9aiOLC/9StEWBY="; session-token="e+hNpPCP1oM6p5wNMjslhZv5OoCHNuGzU3G+fD05F2RBG6LeHjbRwwalKfIhkQlEeS0wWujz9MSXJxn+vIVSMxknya1Bf3hEYGUXEZSflaXo1SCZYv0AxpoHKCHg4AhLfKrFNkp8XML8mp441exyErQpXE/NLrz2hur7T+eoCjolEx1spYp/PeZxXoXaODaqM82UgmJNIxdYU6jGNJjyd9+Uk6y+1gJ8Jewi0Eap3N0="; ubid-main=134-7459411-6895701; x-main=tUJCDSg0LsnQyVKC5zgTLxiVl6wepGaR; csm-hit=tb:9R46KXBWBVDZ3461P580+s-T0D810DPRX7ER9DYFB16|1544198272662&t:1544198272662&adb:adblk_no; csrf=898816657; session-id=145-5526646-5319636; session-id-time=2174857243l; frc=hKt8ZFYpXNGAZqurTl6GMxqOv/6oWmWwx7SUzxS+sR516hUE5YVegE3rMXE/8kFzvlhimhSDEyXXNI8JGdt2ii1egHY69OBQH13ygXLcyYFskhorYwTh109D5Hz6i8ls8RQZISbAD4AxJWpjkCtBZvmFaLXcrFOxrKty7Si6Rz77JU9G1d3xuaWKJd5WCfvn7H88g+uKy3q9hgRMj5BqkkUSqDeMq5ztEx4GtE/+iTgoLq4ShDjOYLh1THRomsUlLhgJXoj+uHCTCUQRtTgyW67up5agLpaoYWLYlvUoOy34fFthxqrxDIfcLGDpYgM/bka87xJVJC2gbmTxyplKpEQcO8rWdoRvTNFUyh2wCcdLOPaL012Pez9Y0VynqagwSHolnUJ7m5T1JR5Egsx3CJg96n6UpgC4Dw==; map-md=eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==","frc":"hKt8ZFYpXNGAZqurTl6GMxqOv/6oWmWwx7SUzxS+sR516hUE5YVegE3rMXE/8kFzvlhimhSDEyXXNI8JGdt2ii1egHY69OBQH13ygXLcyYFskhorYwTh109D5Hz6i8ls8RQZISbAD4AxJWpjkCtBZvmFaLXcrFOxrKty7Si6Rz77JU9G1d3xuaWKJd5WCfvn7H88g+uKy3q9hgRMj5BqkkUSqDeMq5ztEx4GtE/+iTgoLq4ShDjOYLh1THRomsUlLhgJXoj+uHCTCUQRtTgyW67up5agLpaoYWLYlvUoOy34fFthxqrxDIfcLGDpYgM/bka87xJVJC2gbmTxyplKpEQcO8rWdoRvTNFUyh2wCcdLOPaL012Pez9Y0VynqagwSHolnUJ7m5T1JR5Egsx3CJg96n6UpgC4Dw==","map-md":"eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ==","deviceId":"371063725756477172426300874118020547003578611754170125488534022023413249564c5635564d32573831","deviceSerial":"37ef99d33dd9dcc3de240031a8a3d855","refreshToken":"Atnr|EwICIKe3YaLVowB3NNFkLrtpsf0WQ04oVg4hlAqwsELQwdds59pwRtTu95IPTFWqRS3hw5-KdUXgGV2XH665on_wM6B4onWmMeH_mseNOLwbPw9iVO0Vxeu2Z5BIMIESlQ4SRCucMzbPG_cLlRjpBQHUb_DrsIWrHl5aBuc2PDDUTAgFzfkyyE6iHcvtx0QWZ9JGcypFqtEDoVBpBpJQsqk2n__l9HFReYhKVt1fV5mEmmeS0b2m_V8_1O0_s75piOPgildNMUzxPOgKUTz7y45H2rlN3ho9lbO4aCCoGeAxhN9eLG5pqh3gJqeW4Fjophwv9-1lTnG_A4ON6tIBiwdPFyYN8C7P9hmfsUmTkmhgVItL1w","tokenDate":1544221431997,"amazonPage":"amazon.co.uk","localCookie":"session-id=261-0840106-2960911; session-id-time=2174941433l; ubid-acbuk=262-6331458-8885635; x-acbuk=onDO31ZdmvvWHmFmRmrjx5F40zzs4VkO; at-acbuk=Atza|IwEBIO6zZ0S4muGaf0sImmWca6KcuXDKqmY3X_l2n45B1M_vrb1XusZEeTHBiDHpdgLTxTNzhaMd6Z4I9i9fUI3vtB6gslk3qMbSH0dDql399n2N_l1DAS6b9VhN6wq0gEswMjW7dGJCTmvKMrgMF_S3W6SvA_wy_BkaMyPVZfw4fAZhOcPjQ4K1P01s6LrHcNsSy_cr1zXWc6E8I0xWObiFWN8GyZbRyH6TIu6XU_Lbdi-udNgoesgP6lCvXT8sJWc2AagmYMAP1U-fYPKhKS4kwfZXS2wKkkYwZMl6mpOUX0BhABhbexZwyNpCR6l702H8xPTHwUOmhi9Gz2Di9HRXZchM4OmNHXKLFjSztVuhwHo_HFEH-H4durutVOe7K9KxkNACarso-yAUNmoHKlyMHnKlEx8dypL5o0hrlQA3iBD0iblFkzEBLkONuBPs0TOlIOA; sess-at-acbuk=pVCcCaMR/YKPk19IPWSFBA31fqapQiFxSfX3IjJZjs4=; csrf=1031050518","csrf":"1031050518"}

RESULT: Error: No former registration data provided for Cookie Refresh / null

Source code:

/* jshint -W097 /
/
jshint -W030 /
/
jshint strict: false /
/
jslint node: true /
/
jslint esversion: 6 */

const alexaCookie = require('/node/node_modules/alexa-cookie2');

var fs = require('fs');
var alexa_cookie_content = fs.readFileSync('cookie.txt', 'utf8');
console.log(alexa_cookie_content);
console.log(' ');

const config = {
logger: console.log,
formerRegistrationData: {alexa_cookie_content}, // required: provide the result object
email: 'xxxxx@xxxxxx', // optional, amazon email for login to get new cookie
password: 'Xxxxxxx', // optional, amazon password for login to get new cookie
amazonPage: 'amazon.co.uk', // optional: possible to use with different countries, default is 'amaz$
alexaServiceHost: 'alexa.amazon.co.uk',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0',
acceptLanguage: 'en-US' // optional: webpage language, should match to amazon-Page.
};

alexaCookie.refreshAlexaCookie(config, (err, result) => {
console.log('RESULT: ' + err + ' / ' + JSON.stringify(result));
});

Tried also without the option like e-mail, password etc, strict like the example, but same error.

Do I something wrong?

Amazon auth flow appears to have changed.

It's looking like there is some sort of new clientside encryption happening now.
The proxy is returning what looks to be valid cookie data but instead of redirecting it's showing and amazon sign-on page with an error.
image

image

I tried to debug to see if there was a new redirect URL that I needed to catch with the proxy but nothing stood out to me.

Error "Alexa-Cookie: Response (401)"

I want to get alexa cookie from alexa.amazon.co.jp. So, I modified "amazon.com" to "amazon.co.jp" in alexa-cookie.js. But, I could not get cookie with following message.
Now, I don't have any idea to solve this error. Thank you for your advice.

My enviroment:
-node: v10.16.0
-npm: 6.12.0
-Alexa-cookie:3.0.3

Alexa-Cookie: Get User data
{"host":"alexa.amazon.co.jp","path":"/api/users/me?platform=ios&version=2.2.223830.0","method":"GET","headers":{"User-Agent":"AmazonWebView/Amazon Alexa/2.2.223830.0/iOS/11.4.1/iPhone","Accept-Language":"ja-JP","Accept-Charset":"utf-8","Connection":"keep-alive","Accept":"application/json","Cookie":"session-id=131-2011528-2571913; session-id-time=2219020446l; session-token=MFNM0t6MKnaQbqfbG2qef3ipXQ1ADGtdOug/sY5n1ZFRkPcaJWySPa4F0jgwIeibKVM6JnvJx4oKDZw+k+HS5pXSdxrwo4kKRALzXp/57IPyhzOQQF7pzLIt+mjU7uSTiCR9MvxoOYyPAibdkocGeGlu6iLdPf2njXqLXSYRbh5QQxW0x9PhWIiu3/R2r/MDjyYJBZtTRLbxjzWuRKHr82iXuBrGmz4g; ubid-main=135-4077134-3964217; csm-hit=tb:AJGBWYMWKQ7V159ZK2PQ+s-4VXT930QF477M6CRC2NH|1588300011515&t:1588300011515&adb:adblk_no; sid=koSjY7PGWBgGZrq2pt+0Tw==|P7QToSV7Oo4Q+lAIUFe2J4lDoWCCZPcmeq+BNs6Keuk=; frc=miKb5GjxemgtqPxrhDmwHDUD7LawQKDuv3/gv5zmRg0t36QUhO6QW+bdvrrwUH6JsFfJ1hopvMmqxhCBI7rrIqAIOiy0ZU3C7deFsztXVmn4vVWTRyZI7AAda4tiVJNRkAxR4mIjPCJjChvJGWccJwJOS8sejG1dcgodOUf4BuU8vbEKrlQlPLwkc8GtGnn3xe9UtgsIyyDc10m2h0mVh7pfRK7vkppcRuOOYpY8yi9opptlCz+z04hexu4uJ3kGCcNRtDOVRc7BgGV7bT+Jllbb6iq6y7iT9TWnuzTnGL0HcKvGVp7Td0i3rAmMknCfZuEgr/FKvKcTjYQvLl6EUoIfP5slwoHO+iFYeRC2KKHh2xtcmobr7FZUo53BUFNPPR912IurX8ntzaxqHXykHnA9E+F57rkf8g==; map-md=eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ=="}}
Alexa-Cookie: Sending Request with {"host":"alexa.amazon.co.jp","path":"/api/users/me?platform=ios&version=2.2.223830.0","method":"GET","headers":{"User-Agent":"AmazonWebView/Amazon Alexa/2.2.223830.0/iOS/11.4.1/iPhone","Accept-Language":"ja-JP","Accept-Charset":"utf-8","Connection":"keep-alive","Accept":"application/json","Cookie":"session-id=131-2011528-2571913; session-id-time=2219020446l; session-token=MFNM0t6MKnaQbqfbG2qef3ipXQ1ADGtdOug/sY5n1ZFRkPcaJWySPa4F0jgwIeibKVM6JnvJx4oKDZw+k+HS5pXSdxrwo4kKRALzXp/57IPyhzOQQF7pzLIt+mjU7uSTiCR9MvxoOYyPAibdkocGeGlu6iLdPf2njXqLXSYRbh5QQxW0x9PhWIiu3/R2r/MDjyYJBZtTRLbxjzWuRKHr82iXuBrGmz4g; ubid-main=135-4077134-3964217; csm-hit=tb:AJGBWYMWKQ7V159ZK2PQ+s-4VXT930QF477M6CRC2NH|1588300011515&t:1588300011515&adb:adblk_no; sid=koSjY7PGWBgGZrq2pt+0Tw==|P7QToSV7Oo4Q+lAIUFe2J4lDoWCCZPcmeq+BNs6Keuk=; frc=miKb5GjxemgtqPxrhDmwHDUD7LawQKDuv3/gv5zmRg0t36QUhO6QW+bdvrrwUH6JsFfJ1hopvMmqxhCBI7rrIqAIOiy0ZU3C7deFsztXVmn4vVWTRyZI7AAda4tiVJNRkAxR4mIjPCJjChvJGWccJwJOS8sejG1dcgodOUf4BuU8vbEKrlQlPLwkc8GtGnn3xe9UtgsIyyDc10m2h0mVh7pfRK7vkppcRuOOYpY8yi9opptlCz+z04hexu4uJ3kGCcNRtDOVRc7BgGV7bT+Jllbb6iq6y7iT9TWnuzTnGL0HcKvGVp7Td0i3rAmMknCfZuEgr/FKvKcTjYQvLl6EUoIfP5slwoHO+iFYeRC2KKHh2xtcmobr7FZUo53BUFNPPR912IurX8ntzaxqHXykHnA9E+F57rkf8g==; map-md=eyJkZXZpY2VfdXNlcl9kaWN0aW9uYXJ5IjpbXSwiZGV2aWNlX3JlZ2lzdHJhdGlvbl9kYXRhIjp7InNvZnR3YXJlX3ZlcnNpb24iOiIxIn0sImFwcF9pZGVudGlmaWVyIjp7ImFwcF92ZXJzaW9uIjoiMi4yLjIyMzgzMCIsImJ1bmRsZV9pZCI6ImNvbS5hbWF6b24uZWNobyJ9fQ=="}}
Alexa-Cookie: Response (401)
Get User data Response: ""
RESULT: SyntaxError: Unexpected end of JSON input / null

Dcoument how to proper load formerRegistrationData

I can run the script and be ablde to see debug output, however it is not clear which part is necessary to run the alexa-remote-shell script again. If copying the last part which seems to be the complete cookie the shell script says that the cookie is expired.
formerDataStorePath: '...' does not accept a path like "." What am i suppose to pass here?
It is also not clear to me what i should pass to the formerRegistrationData config. May you give me a hint here?

Provide working example.js or documentation

I have never really worked with js so it might be an config issue on my side. Tried the example.js with the provded config (adapted ip to localhost, which should be default - not ...)

However it response with:

  formerRegistrationData: { ... } // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too
                                  ^

SyntaxError: Unexpected token }
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)

May you provide documentation how to use your script to get a cookie in txt format which works with the alexa-remote-control shell script? I think that would help not only me.

Thank you in advance

Proxy return 404

I'm on Linux using your example.js, changing params to "amazon.es" but the proxy returns a 404 error. Neither works with amazon.de:

Suchst du etwas?
Tut uns leid: Die Web-Adresse, die du eingegeben hast, gibt es auf unserer Website nicht.
Zur Amazon.de

Screenshot from 2023-11-06 19-28-53

I'm trying some things. In the browser I can get the amazon main web only if I add a double slash to end of the url http://0.0.0.0:33456// but or it mess up the relative links, or links point https://0.0.0.0 (and the proxy only support http, not https), or the amazon web say I have cookies disabled. Also, what's the point of this attemps? :D

My config:

const config = {
logger: console.log,
amazonPage: 'amazon.de', // optional: possible to use with different countries, default is 'amazon.de'
//acceptLanguage: 'es-ES', // optional: webpage language, should match to amazon-Page, default is 'de-DE'
//userAgent: '...', // optional: own userAgent to use for all request, overwrites default one, should not be needed
proxyOnly: true, // optional: should only the proxy method be used? When no email/password are provided this will set to true automatically, default: false
setupProxy: true, // optional: should the library setup a proxy to get cookie when automatic way did not worked? Default false!
proxyOwnIp: '0.0.0.0', // required if proxy enabled: provide own IP or hostname to later access the proxy. needed to setup all rewriting and proxy stuff internally
proxyPort: 33456, // optional: use this port for the proxy, default is 0 means random port is selected
proxyListenBind: '0.0.0.0',// optional: set this to bind the proxy to a special IP, default is '0.0.0.0'
proxyLogLevel: 'debug', // optional: Loglevel of Proxy, default 'warn'
baseAmazonPage: 'amazon.de', // optional: Change the Proxy Amazon Page - all "western countries" directly use amazon.com including australia! Change to amazon.co.jp for Japan
//amazonPageProxyLanguage: 'es_ES', // optional: language to be used for the Amazon Sign-in page the proxy calls. default is "de_DE")
//deviceAppName: '...', // optional: name of the device app name which will be registered with Amazon, leave empty to use a default one
//formerDataStorePath: '...', // optional: overwrite path where some of the formerRegistrationData are persisted to optimize against Amazon security measures
//formerRegistrationData: { ... }, // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too
//proxyCloseWindowHTML: '...' // optional: use in order to override the default html displayed when the proxy window can be closed, default is 'Amazon Alexa Cookie successfully retrieved. You can close the browser.'
};

On login, when the sms token is asked, page keeps refreshing and it is not possible to type the code

Describe the bug
When it is the first login, Amazon redirects to a page with an input for a number sent to the phone number of the user.
The page keeps refreshing, and on every refresh, the number is cleared.

I can see that there is a form <form id="pollingForm" method="get" action="/ap/cvf/approval/poll">
and the ajax call for /ap/cvf/approval/poll returns a 302 response with redirection to http://localhost:3000/www.amazon.com/404

Without the proxy, the poll returns 200 OK

Eventually it tries to get www.amazon.com/404 , which returns a 404.

Then, this is triggered:

function handlePollingError() {
    window.location.reload();
}

I am investigating and may come up with a solution.
I am getting it from alexa-remote, but I`ve seen it before also on node-red.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the proxy page to login in a machine never logged before, with an account with 2FA enabled
  2. Type user password
  3. Start typing the token from the sms, before finishing it will reload if you are not fast enough

Expected behavior
Do not refresh, token works when login is clicked.

Screenshots & Logfiles
image

Versions:
Latest alexa-remote2

  • Node version: v22.5.0
  • Operating system: Ubuntu 24.04 LTS

Additional context

Maybe a misconfiguration? I am looking into it.

wiki

Hello Apollon77
I am not able to make work that script
Can you help with a wiki ;-) please
I try to find info everywhere but nothing ...
The answer is in you head !

Can't access app via browser

Describe the bug
I followed the directions. I am running on an rPi 4. Starting the app via PM2 seems to work, but the webpage is inaccessible. Starting with no-daemon shows the following:

14:37:48 PM2 | App [AlexaCookie:0] exited with code [1] via signal [SIGINT]
14:37:48 PM2 | App [AlexaCookie:0] starting in -fork mode-
14:37:48 PM2 | App [AlexaCookie:0] online
14:37:48 1|AlexaCookie | Error: listen EACCES: permission denied 0.0.0.0:101
14:37:48 1|AlexaCookie | at Server.setupListenHandle [as _listen2] (net.js:1301:21)
14:37:48 1|AlexaCookie | at listenInCluster (net.js:1366:12)
14:37:48 1|AlexaCookie | at Server.listen (net.js:1452:7)
14:37:48 1|AlexaCookie | at Object. (/home/pi/AlexaCookieNodeJs/AlexaCookie.js:260:8)
14:37:48 1|AlexaCookie | at Module._compile (internal/modules/cjs/loader.js:1063:30)
14:37:48 1|AlexaCookie | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
14:37:48 1|AlexaCookie | at Module.load (internal/modules/cjs/loader.js:928:32)
14:37:48 1|AlexaCookie | at Function.Module._load (internal/modules/cjs/loader.js:769:14)
14:37:48 1|AlexaCookie | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
14:37:48 1|AlexaCookie | at Module._compile (internal/modules/cjs/loader.js:1063:30) {
14:37:48 1|AlexaCookie | code: 'EACCES',
14:37:48 1|AlexaCookie | errno: -13,
14:37:48 1|AlexaCookie | syscall: 'listen',
14:37:48 1|AlexaCookie | address: '0.0.0.0',
14:37:48 1|AlexaCookie | port: 101
14:37:48 1|AlexaCookie | }

How is this used?

Looks like great code, and I'm experience JS developer but only client side and don't know node/npm.

What commands does one run to use this? My end goal is to control alexa via mac command line. I have node/npm installed via brew. Thanks!

cookie location

Hello Apollon77
I follow the example and It gives me a success cookie:

ReferenceError: config is not defined

Alexa-Cookie: Use as Login-Amazon-URL: amazon.fr
Alexa-Cookie: Use as Alexa-Service-Host: alexa.amazon.fr
Alexa-Cookie: Use as User-Agent: ...
Alexa-Cookie: Use as Accept-Language: fr-FR
Alexa-Cookie: Proxy-Mode enabled if needed: localhost:3001 to listen on 0.0.0.0
Alexa-Cookie: Step 1: get first cookie and authentication redirect
Alexa-Cookie: Sending Request with {"host":"alexa.amazon.fr","path":"","method":"GET","headers":{"DNT":"1","Upgrade-Insecure-Requests":"1","User-Agent":"...","Accept-Language":"fr-FR","Connection":"keep-alive","Accept":"/"}}
Alexa-Cookie: Response (302) - Redirect to https://www.amazon.fr/ap/signin?showRmrMe=1&openid.return_to=https%3A%2F%2Falexa.amazon.fr%2F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=amzn_dp_project_dee_fr&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&
Alexa-Cookie: Sending Request with {"host":"www.amazon.fr","path":"/ap/signin?showRmrMe=1&openid.return_to=https%3A%2F%2Falexa.amazon.fr%2F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=amzn_dp_project_dee_fr&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&","method":"GET","headers":{"DNT":"1","Upgrade-Insecure-Requests":"1","User-Agent":"...","Accept-Language":"fr-FR","Connection":"keep-alive","Accept":"/","Cookie":""},"body":""}
Alexa-Cookie: Response (200)
Alexa-Cookie: Step 2: login empty to generate session
Alexa-Cookie: Sending Request with {"host":"www.amazon.fr","path":"/ap/signin","method":"POST","headers":{"DNT":"1","Upgrade-Insecure-Requests":"1","User-Agent":"...","Accept-Language":"fr-FR","Connection":"keep-alive","Content-Type":"application/x-www-form-urlencoded","Referer":"https://www.amazon.fr/ap/signin?showRmrMe=1&openid.return_to=https%3A%2F%2Falexa.amazon.fr%2F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=amzn_dp_project_dee_fr&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&","Cookie":"session-id=262-0763772-4448105; session-id-time=2173556103l","Accept":"/"},"gzip":true,"body":"appActionToken=y4EvZUnft1TjNEyQo25Ff5j2Fj2BZCkj3D&appAction=SIGNIN&openid.return_to=ape%3AaHR0cHM6Ly9hbGV4YS5hbWF6b24uZnIv&prevRID=ape%3AVENNRkpUSzNOQkg1NTBWQ0Q4WEE%3D&workflowState=eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiQTI1NktXIn0.mhkJq6d_GDazQqTEkgtEVzquxBj45OSU0mJtUAAOAsLhDMd-0kf3dw.bY_v35RGfz8SmOdG.wA4HTWsvhwETVTRlC5lABNwfdrHr6Aupp26qBGAU5icKHtROeIFQdL-Y9g1KthrThwwrx6oXFO_3xxDxpDuPo4rUxC3qCbUHA0wj1OdUyza7jbiwSOSay0g2ueRh1K5Gh1wEgUOZ5xKXWt98aO4zLfbWzfsoshRjH8RuaGxgKr9FnIx6sRzD7EEjqAaGirj3Njb96Qej9a-YeUb3WgtFPkqO5-C6Oq7bhQ3zrJPd1tHZl9DLrr7n6GLWTbcUmBcQejbiULwkOPX7NdkgqUvWMhbtB-0VEE5Cv90nBVnNChk.Nm-SowCoJsf_aNpz_im-7Q&showPasswordChecked=false"}
Alexa-Cookie: Response (200)
Alexa-Cookie: Step 3: login with filled form, referer contains session id
Alexa-Cookie: Sending Request with {"host":"www.amazon.fr","path":"/ap/signin","method":"POST","headers":{"DNT":"1","Upgrade-Insecure-Requests":"1","User-Agent":"...","Accept-Language":"fr-FR","Connection":"keep-alive","Content-Type":"application/x-www-form-urlencoded","Referer":"https://www.amazon.fr/ap/signin/262-0763772-4448105","Cookie":"session-id=262-0763772-4448105; session-id-time=2173556103l; ubid-acbfr=261-6690497-9445502","Accept":"/"},"gzip":true,"body":"appActionToken=y4EvZUnft1TjNEyQo25Ff5j2Fj2BZCkj3D&appAction=SIGNIN&openid.return_to=ape%3AaHR0cHM6Ly9hbGV4YS5hbWF6b24uZnIv&prevRID=ape%3AUTcwQTZEMlA0UjA4NURLVDg1Uko%3D&workflowState=eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiQTI1NktXIn0.CL_hAj7EeC2mvQ5xtDfXhtERh4PCBqmSOVmgr52cTuuOrZqaX-AqPA.Pyp2XHaz5tbAJBCm.lfd7C9TEm_us_yceDTzJo9tVSa4g9S7h8DRZEtZOTDbVaNERJUAC1BIIh2b6evMtcEK3djh5uxHAstwmkAwlRhefTCHRDkRudjie6EC31EGOus96ZzBHpDx3eCTSXRoRrQFoTyIKWEQTEO8xIWPkoyxzwEqzcJZ86NcIYNHTOvYW04wyf8wJZwphtE6HNElwnNBb5T2stJc78BghbHUfPcMpLQJ9mfSu4KToqKSSiwgT4QDWMloDEdWuHhji079ZEVkqbsyP77ch5skevJdtkFqTLg.1crWjhBWaeFwOqHfuZK5YA&showPasswordChecked=false&email=xxxxxx&password=xxxxxx"}
Alexa-Cookie: Response (200)
[HPM] Proxy created: !/cookie-success -> https://alexa.amazon.fr
[HPM] Proxy rewrite rule created: "^/www.amazon.fr" ~> ""
[HPM] Proxy rewrite rule created: "^/alexa.amazon.fr" ~> ""
Alexa-Cookie: Proxy-Server listening on port 3001
RESULT: Error: Amazon-Login-Error: Message important !: Pour mieux protéger votre compte, veuillez saisir à nouveau votre mot de passe puis saisissez les caractères affichés dans l'image ci-dessous. You can try to get the cookie manually by opening http://localhost:3001/ with your browser. / null
Router: / / GET / {"host":"localhost:3001","connection":"keep-alive","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.84 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8","accept-encoding":"gzip, deflate, sdch, br","accept-language":"fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4","cookie":"session-id=260-8253396-0371745; session-id-time=2173552599l; csm-hit=tb:JJ3JXFGQD5PC5E9Y1P1Y+s-0RBCBW7JRVSA55MP7R5T|1542832671283&adb:adblk_yes; ubid-acbfr=260-2002289-6197740; session-token="UoQyfzzbe3rVy/5vz1ai1fikHzVhKi6PsV6aVc5IDMzcw5lfdYxg82u7NIOOfdOwwrxDwGlL20oTwJ4AIfEIl86fITckwBMgXzBKb6CgVGkiq7MeLnGty/2ayMUQ4HXu/sgkDE6fYFX5fYF0ML4lf4Ui57cqD7tsG5fY/jcelIyhSjCIgv4umVHKvLoWHXXHHb7Gw+Z5Qim+LoCZn7YderwcFYd7h4BafE2XOLl0UGI="; x-acbfr="VkEQKIg6mfUE9IY0ZB?dImUTXuCT?aZ8D8GEkZFuhuBpGR@ouIUGJaMiQxzjYb5l"; at-acbfr=Atza|IwEBIMg30uh1-7l0RN0-fgfYqUA0e7nzV1poNGPLVvt7EF653NOt2enPfxdxhMKRpM2g7ZPwVRb9kFIZUJF2_gCrg7at7dr2-HD9RsoOUvJkj8wXUHCt64hUf2imOeJjDHqGxInp9xr31UjbXYdLuI1PM8uBz5CWpDiRkfeQvCNveP9HqaUmrHNgG3N_Jl8jkOJZLR_R9fYP5oE7fQsrvlZe_Xlo2wefdYnUw973vs4R9u28sQ4N4H6RdxbEKbK4LELiaQ98XD--4JaJXRYJNLXMEvXVi6V_7-7L9dHG3DXmwvywaPMbvzGKpveprnbljyBXeAaqSTr4bxisluRq7bqcLpIH-8C-TScJnrbQ1Zk-Z51qco4BTOD4AzH06-BJIha1dWhKCm-78t-Zc04SGSjOj3G5; sess-at-acbfr="5w63z+O4d0pmemSpQfpGJZYGNy143KU63EjIOUTe2rY="; sst-acbfr=Sst1|PQFLAPIDApDtI46y2P82DZE1C0OgCvhNALcXGEFxDVwWeGY1hxw5SNvHTcGOLuNjxdP6ZRshMdR_Ia19VVVDgEKV8VsKhDHXkjclRTfM4LKWVH7AJ5QSE4VdcQeSuKfwIRRTxchc-FDBlJ4M3BJss-wIrLD7tJKHo3f51Kn8mMfhfI3pvqGd8dIPh_ff929m5WA0s6vGaUlye1T2p8Dt8xPvA5snU9V5kv7jZccknvpY3KVXH-XhoMhXAwC9NP02EoX9oBTi8SS7byVjclI3pdxx3XAZcYRRzeKJH9arlAD0ZgTe4D6rhQDjsmXNP6HC_wbCYwj4JKrQxmdGiOpV2Ay8bg; csrf=1089872606"}
Alexa-Cookie: Proxy-Request: GET /
Alexa-Cookie: Proxy Response from Host: alexa.amazon.fr
Alexa-Cookie: Proxy detected SUCCESS!!
Alexa-Cookie: Proxy catched cookie: session-id=260-8253396-0371745; session-id-time=2173552599l; csm-hit=tb:JJ3JXFGQD5PC5E9Y1P1Y+s-0RBCBW7JRVSA55MP7R5T|1542832671283&adb:adblk_yes; ubid-acbfr=260-2002289-6197740; session-token="UoQyfzzbe3rVy/5vz1ai1fikHzVhKi6PsV6aVc5IDMzcw5lfdYxg82u7NIOOfdOwwrxDwGlL20oTwJ4AIfEIl86fITckwBMgXzBKb6CgVGkiq7MeLnGty/2ayMUQ4HXu/sgkDE6fYFX5fYF0ML4lf4Ui57cqD7tsG5fY/jcelIyhSjCIgv4umVHKvLoWHXXHHb7Gw+Z5Qim+LoCZn7YderwcFYd7h4BafE2XOLl0UGI="; x-acbfr="VkEQKIg6mfUE9IY0ZB?dImUTXuCT?aZ8D8GEkZFuhuBpGR@ouIUGJaMiQxzjYb5l"; at-acbfr=Atza|IwEBIMg30uh1-7l0RN0-fgfYqUA0e7nzV1poNGPLVvt7EF653NOt2enPfxdxhMKRpM2g7ZPwVRb9kFIZUJF2_gCrg7at7dr2-HD9RsoOUvJkj8wXUHCt64hUf2imOeJjDHqGxInp9xr31UjbXYdLuI1PM8uBz5CWpDiRkfeQvCNveP9HqaUmrHNgG3N_Jl8jkOJZLR_R9fYP5oE7fQsrvlZe_Xlo2wefdYnUw973vs4R9u28sQ4N4H6RdxbEKbK4LELiaQ98XD--4JaJXRYJNLXMEvXVi6V_7-7L9dHG3DXmwvywaPMbvzGKpveprnbljyBXeAaqSTr4bxisluRq7bqcLpIH-8C-TScJnrbQ1Zk-Z51qco4BTOD4AzH06-BJIha1dWhKCm-78t-Zc04SGSjOj3G5; sess-at-acbfr="5w63z+O4d0pmemSpQfpGJZYGNy143KU63EjIOUTe2rY="; sst-acbfr=Sst1|PQFLAPIDApDtI46y2P82DZE1C0OgCvhNALcXGEFxDVwWeGY1hxw5SNvHTcGOLuNjxdP6ZRshMdR_Ia19VVVDgEKV8VsKhDHXkjclRTfM4LKWVH7AJ5QSE4VdcQeSuKfwIRRTxchc-FDBlJ4M3BJss-wIrLD7tJKHo3f51Kn8mMfhfI3pvqGd8dIPh_ff929m5WA0s6vGaUlye1T2p8Dt8xPvA5snU9V5kv7jZccknvpY3KVXH-XhoMhXAwC9NP02EoX9oBTi8SS7byVjclI3pdxx3XAZcYRRzeKJH9arlAD0ZgTe4D6rhQDjsmXNP6HC_wbCYwj4JKrQxmdGiOpV2Ay8bg; csrf=1089872606
Alexa-Cookie: Step 4: get CSRF
Alexa-Cookie: Sending Request with {"host":"alexa.amazon.fr","path":"/api/language","method":"GET","headers":{"DNT":"1","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36","Connection":"keep-alive","Referer":"https://alexa.amazon.fr/spa/index.html","Cookie":"session-id=260-8253396-0371745; session-id-time=2173552599l; csm-hit=tb:JJ3JXFGQD5PC5E9Y1P1Y+s-0RBCBW7JRVSA55MP7R5T|1542832671283&adb:adblk_yes; ubid-acbfr=260-2002289-6197740; session-token="UoQyfzzbe3rVy/5vz1ai1fikHzVhKi6PsV6aVc5IDMzcw5lfdYxg82u7NIOOfdOwwrxDwGlL20oTwJ4AIfEIl86fITckwBMgXzBKb6CgVGkiq7MeLnGty/2ayMUQ4HXu/sgkDE6fYFX5fYF0ML4lf4Ui57cqD7tsG5fY/jcelIyhSjCIgv4umVHKvLoWHXXHHb7Gw+Z5Qim+LoCZn7YderwcFYd7h4BafE2XOLl0UGI="; x-acbfr="VkEQKIg6mfUE9IY0ZB?dImUTXuCT?aZ8D8GEkZFuhuBpGR@ouIUGJaMiQxzjYb5l"; at-acbfr=Atza|IwEBIMg30uh1-7l0RN0-fgfYqUA0e7nzV1poNGPLVvt7EF653NOt2enPfxdxhMKRpM2g7ZPwVRb9kFIZUJF2_gCrg7at7dr2-HD9RsoOUvJkj8wXUHCt64hUf2imOeJjDHqGxInp9xr31UjbXYdLuI1PM8uBz5CWpDiRkfeQvCNveP9HqaUmrHNgG3N_Jl8jkOJZLR_R9fYP5oE7fQsrvlZe_Xlo2wefdYnUw973vs4R9u28sQ4N4H6RdxbEKbK4LELiaQ98XD--4JaJXRYJNLXMEvXVi6V_7-7L9dHG3DXmwvywaPMbvzGKpveprnbljyBXeAaqSTr4bxisluRq7bqcLpIH-8C-TScJnrbQ1Zk-Z51qco4BTOD4AzH06-BJIha1dWhKCm-78t-Zc04SGSjOj3G5; sess-at-acbfr="5w63z+O4d0pmemSpQfpGJZYGNy143KU63EjIOUTe2rY="; sst-acbfr=Sst1|PQFLAPIDApDtI46y2P82DZE1C0OgCvhNALcXGEFxDVwWeGY1hxw5SNvHTcGOLuNjxdP6ZRshMdR_Ia19VVVDgEKV8VsKhDHXkjclRTfM4LKWVH7AJ5QSE4VdcQeSuKfwIRRTxchc-FDBlJ4M3BJss-wIrLD7tJKHo3f51Kn8mMfhfI3pvqGd8dIPh_ff929m5WA0s6vGaUlye1T2p8Dt8xPvA5snU9V5kv7jZccknvpY3KVXH-XhoMhXAwC9NP02EoX9oBTi8SS7byVjclI3pdxx3XAZcYRRzeKJH9arlAD0ZgTe4D6rhQDjsmXNP6HC_wbCYwj4JKrQxmdGiOpV2Ay8bg; csrf=1089872606","Accept":"/","Origin":"https://alexa.amazon.fr"}}
Alexa-Cookie: Response (200)
Alexa-Cookie: Result: csrf=1089872606, Cookie=session-id=260-8253396-0371745; session-id-time=2173552599l; csm-hit=tb:JJ3JXFGQD5PC5E9Y1P1Y+s-0RBCBW7JRVSA55MP7R5T|1542832671283&adb:adblk_yes; ubid-acbfr=260-2002289-6197740; session-token="UoQyfzzbe3rVy/5vz1ai1fikHzVhKi6PsV6aVc5IDMzcw5lfdYxg82u7NIOOfdOwwrxDwGlL20oTwJ4AIfEIl86fITckwBMgXzBKb6CgVGkiq7MeLnGty/2ayMUQ4HXu/sgkDE6fYFX5fYF0ML4lf4Ui57cqD7tsG5fY/jcelIyhSjCIgv4umVHKvLoWHXXHHb7Gw+Z5Qim+LoCZn7YderwcFYd7h4BafE2XOLl0UGI="; x-acbfr="VkEQKIg6mfUE9IY0ZB?dImUTXuCT?aZ8D8GEkZFuhuBpGR@ouIUGJaMiQxzjYb5l"; at-acbfr=Atza|IwEBIMg30uh1-7l0RN0-fgfYqUA0e7nzV1poNGPLVvt7EF653NOt2enPfxdxhMKRpM2g7ZPwVRb9kFIZUJF2_gCrg7at7dr2-HD9RsoOUvJkj8wXUHCt64hUf2imOeJjDHqGxInp9xr31UjbXYdLuI1PM8uBz5CWpDiRkfeQvCNveP9HqaUmrHNgG3N_Jl8jkOJZLR_R9fYP5oE7fQsrvlZe_Xlo2wefdYnUw973vs4R9u28sQ4N4H6RdxbEKbK4LELiaQ98XD--4JaJXRYJNLXMEvXVi6V_7-7L9dHG3DXmwvywaPMbvzGKpveprnbljyBXeAaqSTr4bxisluRq7bqcLpIH-8C-TScJnrbQ1Zk-Z51qco4BTOD4AzH06-BJIha1dWhKCm-78t-Zc04SGSjOj3G5; sess-at-acbfr="5w63z+O4d0pmemSpQfpGJZYGNy143KU63EjIOUTe2rY="; sst-acbfr=Sst1|PQFLAPIDApDtI46y2P82DZE1C0OgCvhNALcXGEFxDVwWeGY1hxw5SNvHTcGOLuNjxdP6ZRshMdR_Ia19VVVDgEKV8VsKhDHXkjclRTfM4LKWVH7AJ5QSE4VdcQeSuKfwIRRTxchc-FDBlJ4M3BJss-wIrLD7tJKHo3f51Kn8mMfhfI3pvqGd8dIPh_ff929m5WA0s6vGaUlye1T2p8Dt8xPvA5snU9V5kv7jZccknvpY3KVXH-XhoMhXAwC9NP02EoX9oBTi8SS7byVjclI3pdxx3XAZcYRRzeKJH9arlAD0ZgTe4D6rhQDjsmXNP6HC_wbCYwj4JKrQxmdGiOpV2Ay8bg; csrf=1089872606
RESULT: null / {"cookie":"session-id=260-8253396-0371745; session-id-time=2173552599l; csm-hit=tb:JJ3JXFGQD5PC5E9Y1P1Y+s-0RBCBW7JRVSA55MP7R5T|1542832671283&adb:adblk_yes; ubid-acbfr=260-2002289-6197740; session-token="UoQyfzzbe3rVy/5vz1ai1fikHzVhKi6PsV6aVc5IDMzcw5lfdYxg82u7NIOOfdOwwrxDwGlL20oTwJ4AIfEIl86fITckwBMgXzBKb6CgVGkiq7MeLnGty/2ayMUQ4HXu/sgkDE6fYFX5fYF0ML4lf4Ui57cqD7tsG5fY/jcelIyhSjCIgv4umVHKvLoWHXXHHb7Gw+Z5Qim+LoCZn7YderwcFYd7h4BafE2XOLl0UGI="; x-acbfr="VkEQKIg6mfUE9IY0ZB?dImUTXuCT?aZ8D8GEkZFuhuBpGR@ouIUGJaMiQxzjYb5l"; at-acbfr=Atza|IwEBIMg30uh1-7l0RN0-fgfYqUA0e7nzV1poNGPLVvt7EF653NOt2enPfxdxhMKRpM2g7ZPwVRb9kFIZUJF2_gCrg7at7dr2-HD9RsoOUvJkj8wXUHCt64hUf2imOeJjDHqGxInp9xr31UjbXYdLuI1PM8uBz5CWpDiRkfeQvCNveP9HqaUmrHNgG3N_Jl8jkOJZLR_R9fYP5oE7fQsrvlZe_Xlo2wefdYnUw973vs4R9u28sQ4N4H6RdxbEKbK4LELiaQ98XD--4JaJXRYJNLXMEvXVi6V_7-7L9dHG3DXmwvywaPMbvzGKpveprnbljyBXeAaqSTr4bxisluRq7bqcLpIH-8C-TScJnrbQ1Zk-Z51qco4BTOD4AzH06-BJIha1dWhKCm-78t-Zc04SGSjOj3G5; sess-at-acbfr="5w63z+O4d0pmemSpQfpGJZYGNy143KU63EjIOUTe2rY="; sst-acbfr=Sst1|PQFLAPIDApDtI46y2P82DZE1C0OgCvhNALcXGEFxDVwWeGY1hxw5SNvHTcGOLuNjxdP6ZRshMdR_Ia19VVVDgEKV8VsKhDHXkjclRTfM4LKWVH7AJ5QSE4VdcQeSuKfwIRRTxchc-FDBlJ4M3BJss-wIrLD7tJKHo3f51Kn8mMfhfI3pvqGd8dIPh_ff929m5WA0s6vGaUlye1T2p8Dt8xPvA5snU9V5kv7jZccknvpY3KVXH-XhoMhXAwC9NP02EoX9oBTi8SS7byVjclI3pdxx3XAZcYRRzeKJH9arlAD0ZgTe4D6rhQDjsmXNP6HC_wbCYwj4JKrQxmdGiOpV2Ay8bg; csrf=1089872606","csrf":"1089872606"}

the question now is how to make it work with alexa-remote-control? where to put that cookie
or I am missing a part of the code
Your help will be much apreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.