abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
10.17k stars 865 forks source link

HTTP 400 - Bad Request comes from an office365 enterprise account. #862

Closed Reasonss closed 4 years ago

Reasonss commented 4 years ago
➜  onedrive onedrive --synchronize --verbose --confdir="~/.config/onedriveWork"
Using Config Dir: /home/reason**/.config/onedriveWork
No config file found, using application defaults
Initializing the OneDrive API ...
Authorize this app visiting:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=22c49a0d-d21c-4792-aed1-8f163c982546&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.ReadWrite.All%20offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient

Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=0.ASsAlKDUSbCJcEafvknJlIXtpQ2axCIc0pJHrtGPFjyYJUYrAPw.AQABAAIAAAAm-06blBE1TpVMil8KPQ41eyPZSPy1C43nyCf5Mjod7KeXqQWNucwhYWhHxm2E8DpM02rsbmQwGXhsajShDm2jjUn50J0juk6XWzZMaVsG6b7KPYby-qtr3hbFl4KU92Xv1OmWBWmt8e7QWPbqgC48B6T7bbwLW8n6k-5-xhNrbdLUx35jlAtGw4OmKDdBCQsd0Y5mAJEftKn5zP0pgIVCjCxF2XmS67ROHlThn_kYd5XhNxL086EZ8ux_vLPikY7910T8UwZmu7HVN8hB31zqEkBEH_xx1WH3oyxwWZRdZGAblRWHcbZylkdSFUAJqRha-XFr3GJlaz2uG5bKlHf-7tAmZqT6U270oNN7Fw9_YSqWoDyLkebW7Qig2fv7bEyS-70sFdG3pnRObO4y-Krwv2UadczPpKNNjmyxB1W7gzfwRbqEbuqPIEoBVuk3UxlIRvx2JyrA3qp9ab50enZedb7A8N6VW5D15-t2RQlrbaXdzMKc8R8p52hEeu_TBRNdidWCTLTqyqU8d5m_yaMMoRlKV_a_vhY5faPOZadp3L3qK7ruyOyBm9sVwcWbKGb_5UZARwRP4JaC4ozSJ89JSOj5I3jmRxFGKvCAFLlrjQnm6Bak8hhKYK-3ozTRwW4gAA&session_state=4a2217e1-ad58-4ade-81d5-33186*******
OneDrive returned a 'HTTP 400 - Bad Request' - gracefully handling error
onedrive.OneDriveException@src/onedrive.d(874): HTTP request returned status code 400 (Bad Request)
{
    "correlation_id": "de90a510-4420-4eed-b4cd-4896c33eaecd",
    "error": "invalid_grant",
    "error_codes": [
        9002313
    ],
    "error_description": "AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: c054949b-774c-4581-a511-97758cd30900\r\nCorrelation ID: de90a510-4420-4eed-b4cd-4896c33eaecd\r\nTimestamp: 2020-04-08 03:20:46Z",
    "error_uri": "https:\/\/login.microsoftonline.com\/error?code=9002313",
    "timestamp": "2020-04-08 03:20:46Z",
    "trace_id": "c054949b-774c-4581-a511-97758cd30900"
}
----------------
src/onedrive.d:52 void onedrive.OneDriveApi.checkHttpCode(ref const(std.json.JSONValue)) [0x56119f2bcd68]
src/onedrive.d:560 std.json.JSONValue onedrive.OneDriveApi.post!(char).post(const(char)[], const(char)[]) [0x56119f2bd3b6]
src/onedrive.d:425 void onedrive.OneDriveApi.acquireToken(const(char)[]) [0x56119f2bb6d5]
src/onedrive.d:410 void onedrive.OneDriveApi.redeemToken(const(char)[]) [0x56119f2bb5ba]
src/onedrive.d:208 bool onedrive.OneDriveApi.authorize() [0x56119f2ba101]
src/onedrive.d:150 bool onedrive.OneDriveApi.init() [0x56119f2b9ba8]
src/main.d:431 _Dmain [0x56119f2b5dc1]
abraunegg commented 4 years ago

@Reasonss Please can you update your post following the directions as per: https://github.com/abraunegg/onedrive#reporting-issues

  1. You have not used the new issue template
  2. You have not provided all the required information as per the new issue template
  3. The bug output above does not correlate with the current codebase

Please can you fix up your post and follow the directions please.

abraunegg commented 4 years ago

@Reasonss Based on output, most likely a duplicate issue - https://github.com/abraunegg/onedrive/issues/802, https://github.com/abraunegg/onedrive/issues/829 - which is resolved already via https://github.com/abraunegg/onedrive/pull/830

abraunegg commented 4 years ago

@Reasonss Please can you respond

Reasonss commented 4 years ago

When I updated the master version released yesterday, it could parse the url obtained by the enterprise account of office365, and it has been working normally now, thank you~

---Original--- From: "abraunegg"<notifications@github.com> Date: Thu, Apr 9, 2020 15:52 PM To: "abraunegg/onedrive"<onedrive@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Reasonss"<952519932@qq.com>; Subject: Re: [abraunegg/onedrive] HTTP 400 - Bad Request comes from an office365 enterprise account. (#862)

@Reasonss Please can you respond

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Reasonss commented 4 years ago

onedrive --version onedrive v2.4.0-12-g1c555c3

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.