Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to login: 401 Unauthorized (AADSTS700025) #30

Open
MlgmXyysd opened this issue Oct 25, 2023 · 3 comments
Open

Unable to login: 401 Unauthorized (AADSTS700025) #30

MlgmXyysd opened this issue Oct 25, 2023 · 3 comments

Comments

@MlgmXyysd
Copy link

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": "/",
......
@virtualzone
Copy link
Owner

Hi @MlgmXyysd , I've tried to reproduce your issue but I can't. Have you followed the instructions from the Readme on how to create the app registration?

@MlgmXyysd
Copy link
Author

MlgmXyysd commented Oct 25, 2023

Hi @MlgmXyysd , I've tried to reproduce your issue but I can't. Have you followed the instructions from the Readme on how to create the app registration?

image
image
image
image

@binoypatel
Copy link

Having same issue and removing client secret worked, thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants