chrisgavin / cheeky_acd_cli

A cheeky fork of acd_cli.
Other
23 stars 2 forks source link

refresh token #2

Open ebouda33 opened 7 years ago

ebouda33 commented 7 years ago

Sorry, but under mac os i don't arrive to take the refresh token i ve you some solution ?

i ll try the old refresh that begin Atzr but doesn t work.

ebouda33 commented 7 years ago

Traceback (most recent call last): File "/usr/local/bin/acdcli", line 9, in load_entry_point('acdcli==0.3.2', 'console_scripts', 'acdcli')() File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/EGG-INFO/scripts/acd_cli.py", line 1657, in main acd_client = client.ACDClient(CACHE_PATH, SETTINGS_PATH) File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/client.py", line 43, in init self.handler = oauth.create_handler(cache_path) File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/oauth.py", line 25, in create_handler return CheekyOAuthHandler(path) File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/oauth.py", line 45, in init self.load_oauth_data() File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/oauth.py", line 106, in load_oauth_data self.get_auth_token(reload=False) File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/oauth.py", line 124, in get_auth_token self.refresh_auth_token() File "/usr/local/lib/python3.4/dist-packages/acdcli-0.3.2-py3.4.egg/acdcli/api/oauth.py", line 172, in refresh_auth_token 'Error refreshing authentication token: %s' % response.text) acdcli.api.common.RequestError: RequestError: 1004, Error refreshing authentication token: {"error_description":"The request has an invalid parameter : source_token","error":"InvalidValue"}

ebouda33 commented 7 years ago

how you do it to work?

???!!!!

chrisgavin commented 7 years ago

You need a token from the Amazon Drive app. The old acd_cli token won't work.

The procedure for obtaining the token on macOS is essentially the same as Windows, but you will need a different tool to dump the memory of the Amazon Drive process. I just tested this with gcore and it worked well.

ghost commented 7 years ago

Whats the trick? Even after up- and downloading files to acd with the native windows app the token could not be found in the memory dump.

I got it working with the refresh token generated by another whitelisted acd app, not sure if they will be banned soon as well.

realcanadrian commented 7 years ago

@chrisgavin, thanks for putting this together. I'm using the Windows app, and I've synced a folder, and using either HxD or NotePad++ with the hex editor plugin I can't find "Atnr|" anywhere in the dump file. Am I doing something wrong?

chrisgavin commented 7 years ago

It worked pretty reliably for me, but maybe it doesn't load the refresh token until it needs to refresh the access token (after an hour at most). Maybe try leaving it running for an hour before doing the memory dump.

The alternative option if the memory dump option is not working is to use Fiddler to intercept the traffic. You just have to enable HTTPS interception and install the certificate, then wait for a request to /auth/token. This will contain your refresh token in a header.

realcanadrian commented 7 years ago

Awesome, thanks Chris.

realcanadrian commented 7 years ago

Working perfectly using Fiddler method. :)

blach commented 7 years ago

It worked great for me on macOS using gcore as mentioned by @chrisgavin as well as Hex Fiend:

ghost commented 7 years ago

It is like chris stated - the app needs to run some hours (or exactly until first refresh was made), until the token is retrieved from amazon.

Thx for the fork!

moregatest commented 7 years ago

Hi All, Just for reference. I found "refresh token" in request body~~,not in header~