alex-phillips / clouddrive-php

Amazon Cloud Drive API and CLI for PHP
MIT License
36 stars 9 forks source link

Could not authenticate #24

Closed OskarStark closed 7 years ago

OskarStark commented 7 years ago

This is the used URL: bildschirmfoto 2016-11-14 um 15 26 55

Maybe this fixes: https://github.com/nikkiii/flysystem-acd/issues/7

therealssj commented 7 years ago

The client_id in the url seems to be missing. I guess that is what the issue. Putting that in should resolve your issue. Please close the issue if that fixes it.

OskarStark commented 7 years ago

HI @therealssj,

I am using the steps from the README: https://github.com/alex-phillips/clouddrive-php#setup and this should I guess

therealssj commented 7 years ago

@OskarStark u need to create a security profile and from there you get the CLIENT_ID and CLIENT_SECRET

After you are done creating a security profile you will get a CLIENT_ID and CLIENT_SECRET which you need to use with this script.

alex-phillips commented 7 years ago

@OskarStark I haven't updated the readme setup process yet, but if you pull the master branch I've adjusted the code so that you can use the CLI without your own security profile. It will hit a Google AppEngine endpoint I have and authorize you with my security profile.

For security purposes, I've open sourced the endpoint here: https://github.com/alex-phillips/clouddrive-endpoint

OskarStark commented 7 years ago

Hi @alex-phillips , thank you for your feedback!

I created a security profile and now I have a CLIENT_ID and a SECRET, but if i open the URL, this is my result: bildschirmfoto 2016-11-23 um 08 53 24

I am using https://github.com/nikkiii/flysystem-acd and it requires already dev-master of your lib. I will do composer update now.

OskarStark commented 7 years ago

Hi again,

i set clientid and secret both empty (after a composer update), and the output changes to: bildschirmfoto 2016-11-23 um 08 55 57

I opened the url an authenticated my account with my amazon credentials ✅

But the response looks like this: bildschirmfoto 2016-11-23 um 08 57 23 bildschirmfoto 2016-11-23 um 08 57 26

Is this correct?

OskarStark commented 7 years ago

The second time i did the login with my credentials i got something like this:

{"access_token":"FOO","refresh_token":"BAR","token_type":"bearer","expires_in":3598}

What shall i do with these response?

Thanks for helping me out! 👍

therealssj commented 7 years ago

@OskarStark IIRC after you authorize you are supposed to paste the output into the terminal so the cli can prolly save the access_token and the refresh_token in the sqlite database for future. The refresh_token is crucial for the working of the cli.

OskarStark commented 7 years ago

Ok great, after pasting the json to the cli, it seems to work! 👍

Thank you guys, but we should definitely work on the README/Setup instructions 😄