Open ghost opened 7 years ago
I added a platform of type "Native application" (there is no "Mobile application" platform), then after entering the code I got, it gave me this error:
{"error":"invalid_request","error_description":"Public clients can't send a client secret."}
And if I remove the dashes from the client ID, I'm redirected here:
https://login.live.com/err.srf?lc=1033#error=unauthorized_client&error_description=The+client+does+not+exist.+If+you+are+the+application+developer%2c+configure+a+new+application+through+the+application+management+site+at+https://apps.dev.microsoft.com/.
You need to create the app using the link in the instructions... I accessed using the link but I wasn't logged, so I logged and the page that opens is different than the one if you log first and than click the link. And then add Native Application as Platform.
I found a solution how to work with the "Native App" (for OneDrive Personal).
Take backups of files to change:
cp onedrive-authorize onedrive-authorize_bck
cp onedrive-base onedrive-base_bck
In file onedrive-authorize change the following lines:
"https://login.live.com/oauth20_authorize.srf?client_id=${api_client_id}&scope=wl.offline_access%20${api_permissions}&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf"
to
"https://login.live.com/oauth20_authorize.srf?client_id=${api_client_id}&scope=wl.offline_access%20${api_permissions}&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient"
And
api_json_result=$(curl -s -d "client_id=${api_client_id}&client_secret=${api_client_secret}&code=${code}&grant_type=authorization_code&redirect_uri=https://login.live.com/oauth20_desktop.srf" -X POST "${api_auth_url}")
to
api_json_result=$(curl -s -d "client_id=${api_client_id}&code=${code}&grant_type=authorization_code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient" -X POST "${api_auth_url}")
In file onedrive-base remove the following line:
--data-urlencode "client_secret=${api_client_secret}" \
(Do not comment out, as it does not seem to work for me for any reason)
Thank you @primuszoon. That worked for me.
hmm, i get it working. app type is native and i leave that secret line empty, not needed to remove or change any other line on onedrive.cfg file than "api_client_id".
Even the original readme.md says that application id cannot have dashes (-), it takes them anyways, without them it dosnt recognize the id correctly :)
Woow that was easy! Thanks!
When I open the URL given to me by
./onedrive-authorize
, I get redirected to this URL: