onedrive-uploader icon indicating copy to clipboard operation
onedrive-uploader copied to clipboard

Unable to login: 401 Unauthorized (AADSTS700025)

Open MlgmXyysd opened this issue 8 months ago • 3 comments

Issue

Could not log in: verify you're using the client secret's value (not ID) and the API permissions are set correctly

Reason

Microsoft doesn't allow public client to redeem authorization code with client_secret, so the login logic needs to update.

401 Unauthorized
error: invalid_client
error_description: AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented.
error_codes: 700025

Target code

https://github.com/virtualzone/onedrive-uploader/blob/main/sdk/login.go#L98

Temp solution

Remove client_secret in config:

{
    "client_id": "xxxxxxxxxxxxxxxxxx",
    "client_secret": "", <- Put to empty
    "scopes" [
        "Files.Read",
        "Files.ReadWrite",
        "Files.Read.All",
        "Files.ReadWrite.All",
        "offline_access"
    ],
    "redirect_uri": "http://localhost:53682/",
    "root": "/",
......

MlgmXyysd avatar Oct 25 '23 07:10 MlgmXyysd