HTTP request returned status code 400 (Bad Request)
zzavatar09 opened this issue · comments
I have install OneDrive with the commands
- sudo apt update
2.sudo apt install onedrive
when I Authorize, it respones:
Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=...
onedrive.OneDriveException@src/onedrive.d(874): HTTP request returned status code 400 (Bad Request)
{
"correlation_id": "64d1e5cf-df63-4815-8c5f-efdaba5e6b22",
"error": "invalid_grant",
"error_codes": [
70000
],
"error_description": "AADSTS70000: The provided value for the 'code' parameter is not valid.\r\nTrace ID: 6fb652df-7991-41d3-8e74-ba734cad2800\r\nCorrelation ID: 64d1e5cf-df63-4815-8c5f-efdaba5e6b22\r\nTimestamp: 2020-08-15 23:15:30Z",
"error_uri": "https://login.microsoftonline.com/error?code=70000",
"timestamp": "2020-08-15 23:15:30Z",
"trace_id": "6fb652df-7991-41d3-8e74-ba734cad2800"
}
??:? [0x564a8c6949d9]
??:? [0x564a8c693cb5]
??:? [0x564a8c694b65]
??:? [0x564a8c692f58]
??:? [0x564a8c6928c5]
??:? [0x564a8c6a07a8]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7f294a2149db]
??:? _d_run_main2 [0x7f294a2147ee]
??:? _d_run_main [0x7f294a21465d]
??:? __libc_start_main [0x7f2949e000b2]
??:? [0x564a8c66b5ed]
what's wrong with me? how I do?
I have install OneDrive with the commands
- sudo apt update
2.sudo apt install onedrive
when I Authorize, it respones:
...
what's wrong with me? how I do?
Your issue is this:
sudo apt install onedrive
Do not do this .. this is very wrong. By doing this you have installed an old and unsupported version.
If you are using some sort of Ubuntu variant .. refer to this: https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md#important-information-for-ubuntu-users
To resolve your situation:
sudo apt remove onedrive
Then follow: https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md
Additionally the 'skilion' repo was abandoned in 2018 and contains many defects that put you at risk of data loss and corruption if you use it. The original author is totally uncontactable despite numerous efforts by myself and others. Do not use this repo.
The latest and maintained code can be found here: https://github.com/abraunegg/onedrive
To be notified of new releases / bug fixes please 'star' and 'watch' the new repo location.
Major differences / Enhancements:
- Existing bugs with 'skilion' client fixed
- File upload / download validation to ensure data integrity
- Support for SharePoint / Office 365 Shared Libraries
- Support for OneDrive Business Shared Folders
- Desktop notifications via libnotify
- Dry-run capability to test configuration changes
- Prevent major OneDrive accidental data deletion after configuration change
- Support National Azure Cloud instances
Thanks
I have install OneDrive with the commands
- sudo apt update
2.sudo apt install onedrive
when I Authorize, it respones:
...
what's wrong with me? how I do?Your issue is this:
sudo apt install onedrive
Do not do this .. this is very wrong. By doing this you have installed an old and unsupported version.
If you are using some sort of Ubuntu variant .. refer to this: https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md#important-information-for-ubuntu-users
To resolve your situation:
sudo apt remove onedrive
Then follow: https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md
Additionally the 'skilion' repo was abandoned in 2018 and contains many defects that put you at risk of data loss and corruption if you use it. The original author is totally uncontactable despite numerous efforts by myself and others. Do not use this repo.
The latest and maintained code can be found here: https://github.com/abraunegg/onedrive
To be notified of new releases / bug fixes please 'star' and 'watch' the new repo location.
Major differences / Enhancements:
- Existing bugs with 'skilion' client fixed
- File upload / download validation to ensure data integrity
- Support for SharePoint / Office 365 Shared Libraries
- Support for OneDrive Business Shared Folders
- Desktop notifications via libnotify
- Dry-run capability to test configuration changes
- Prevent major OneDrive accidental data deletion after configuration change
- Support National Azure Cloud instances
Thank you! I am running Ubuntu 2004 and this pretty much solved it, but I should say that I had to manually remove the onedrive folder on my home directory for it to work.
The first time I tried, I hadn't deleted the onedrive folder (from my home directory) and I was still getting the error. After deleting the onedrive folder I cloned the onedrive folder, installed and voilà. It was working (also I had to re-authorize the onedrive application for my account on the browser).
to sum up what I did:
sudo apt install libnotify-dev
git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure
sudo make
sudo make install
onedrive
PS: I had ran a sudo apt autoremove
before doing all of this (and that may be the reason why I was able to install "libnotify-dev", unlike "libcurl4-openssl-dev", "build-essential", "curl", "git", etc. etc.
PS2: I am a newbie at using linux and can't explain most of the things I did
to sum up what I did:
sudo apt install libnotify-dev
git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure
sudo make
sudo make install
onedrive
Thanks~ After sudo apt autoremove
and source ~/dlang/dmd-2.106.0/activate
in·abraunegg/onedrive#2449 (to resolve ./configure -> configure: error: Could not find any compatible D compiler
), I confront following by sudo make
:
(dmd-2.106.0)(base) <user@name>:~/github/onedrive$ sudo make
if [ -f .git/HEAD ] ; then \
git describe --tags > version ; \
else \
echo v2.4.25 > version ; \
fi
dmd -w -g -O -J. -L-lcurl -L-lsqlite3 -L-ldl src/config.d src/itemdb.d src/log.d src/main.d src/monitor.d src/onedrive.d src/qxor.d src/selective.d src/sqlite.d src/sync.d src/upload.d src/util.d src/progress.d src/arsd/cgi.d -ofonedrive
make: dmd: Command not found
make: *** [Makefile:102: onedrive] Error 127
likely similar output as #251 where my local
(dmd-2.106.0)(base) <user@name>:~/github/onedrive$which dmd
/home/<username>/dlang/dmd-2.106.0/linux/bin64/dmd
and I can definitely run directly from same terminal
dmd -w -g -O -J. -L-lcurl -L-lsqlite3 -L-ldl src/config.d src/itemdb.d src/log.d src/main.d src/monitor.d src/onedrive.d src/qxor.d src/selective.d src/sqlite.d src/sync.d src/upload.d src/util.d src/progress.d src/arsd/cgi.d -ofonedrive
and then later on
(base) <user>@<name>:~/github/onedrive$ sudo make install
/usr/bin/install -c -D onedrive /usr/local/bin/onedrive
/usr/bin/install -c -D -m 0644 onedrive.1 /usr/local/share/man/man1/onedrive.1
/usr/bin/install -c -D -m 0644 contrib/logrotate/onedrive.logrotate /usr/local/etc/logrotate.d/onedrive
mkdir -p /usr/local/share/doc/onedrive
/usr/bin/install -c -D -m 0644 README.md config LICENSE CHANGELOG.md docs/Docker.md docs/INSTALL.md docs/SharePoint-Shared-Libraries.md docs/USAGE.md docs/BusinessSharedFolders.md docs/advanced-usage.md docs/application-security.md /usr/local/share/doc/onedrive
/usr/bin/install -c -d -m 0755 /usr/lib/systemd/user /lib/systemd/system
/usr/bin/install -c -m 0644 contrib/systemd/onedrive@.service /lib/systemd/system
/usr/bin/install -c -m 0644 contrib/systemd/onedrive.service /usr/lib/systemd/user
and seems better than my code performance in #512
(base) <nser>@<name>:~/github/onedrive$ onedrive
Configuring Global Azure AD Endpoints
Authorize this app visiting:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=**&scope=Files.ReadWrite%20Files.ReadWrite.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient
Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=**
Application has been successfully authorised, however no additional command switches were provided.
Please use 'onedrive --help' for further assistance in regards to running this application.
To correctly install on Ubuntu you must follow this document: https://github.com/abraunegg/onedrive/blob/master/docs/ubuntu-package-install.md