iRedScarf / onedrive-index

OneDrive public directory listing, and One-Click Deploy to Vercel. Powered by Vercel and Next.js.
https://odi.freeloop.one
MIT License
68 stars 66 forks source link

Error to connect on microsoft #5

Closed dsakura closed 1 year ago

dsakura commented 1 year ago

My account is E5, and I'm getting this error when trying to log in. AADSTS900144: The request body must contain the following parameter: 'client_id'.

I have another question, off topic, about E5, can I made here? write to you? Many thanks

iRedScarf commented 1 year ago

It looks like you didn't set the Client_ID properly.

dsakura commented 1 year ago

I start clicking the deploy buttom here, and add the variables on the vercel setup. Do I need to clone this repository too? onedriveid2 onedriveid

The request id and correlation id showed on the error are diferent from the NEXT_PUBLIC_CLIENT_ID that I copied from the azure, i checked now. Thanks an sorry my bad english

iRedScarf commented 1 year ago

If you click the deploy button directly in README.md, there is no need to clone this repository (Vercel will automatically clone this repository and create a private repository for you).

At the same time, among your environment variables, only NEXT_PUBLIC_SITE_TITLE needs to use the NEXT_PUBLIC_ prefix.

Several other environment variables do not need to use the NEXT_PUBLIC_ prefix. They are USER_PRINCIPAL_NAME, BASE_DIRECTORY, CLIENT_ID, CLIENT_SECRET.

I guess the problem you encountered may be because USER_PRINCIPAL_NAME, BASE_DIRECTORY, CLIENT_ID, and CLIENT_SECRET use the NEXT_PUBLIC_ prefix?

dsakura commented 1 year ago

Ah problaby its that! Im traveling by now, but I'll teste edit the variables names. Many thanks @iRedScarf !

iRedScarf commented 1 year ago

You're welcome. Have a good trip :D

dsakura commented 1 year ago

Many thanks. Now I have this error:

AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.
Trace ID: 3e6cd518-6999-4d25-9476-9b5d7a741c00
Correlation ID: 7ffb7bc2-29ea-4d3f-9b61-5cd68b450a4a
Timestamp: 2023-10-20 16:28:19Z

need to be an App Registration or a Business Application? Thanks

nm this... I was anxious and forgot to obfuscate the secret. Sorry. But this message its normal? vercel

3kh0 commented 1 year ago

Yeah I am also getting this error, all the env vars have the correct names

image

and I got this error:

image

with the Microsoft wiki saying this:

Error Code | 70002
Message | Client  application name '{appName}' is not valid or the credentials used to  authenticate the client could not be understood by the server.
Remediation | Developer error - the app is attempting to sign in without the necessary or correct authentication parameters.

Any ideas?

dsakura commented 1 year ago

@3kh0 do you obsfuscate your secret value?

3kh0 commented 1 year ago

@3kh0 do you obsfuscate your secret value?

No, it is just stored in plain text

dsakura commented 1 year ago

@3kh0 Try obsfucate. https://ovi.swo.moe/docs/advanced#modify-configs-in-apiconfigjs Change the valor and do the redeploy again

3kh0 commented 1 year ago

@dsakura Ah ok, that worked, thank you so much!

dsakura commented 1 year ago

I changed the address I want to share, I made sure I was logged into the right account that has the API and OneDrive, and I continue to receive this message "Do not pretend to be the site owner".

Do I need to conect to vercel with same microsoft account?

dsakura commented 1 year ago

Well, I delete everything and restart, perfect! Sorry bother with many messages and again, thank you very much! One doubt: how I set a folder with name that have space between the words? Thanks

iRedScarf commented 1 year ago

You can completely copy and paste the directory name on/back.

For example, the complete directory path with spaces in the directory name is /share/a and b/, where /share is the folder where the content you want to share (meaning that you are not sharing the entire OneDrive folder), /share/a and b/ is you If you need an encrypted folder, you can fill in /share in BASE_DIRECTORY and /a and b in NEXT_PUBLIC_PROTECTED_ROUTES. If there are multiple encrypted directories, you can separate them with a ,.

The following are the settings of my Demo page, in which BASE_DIRECTOY is filled in /, which means that I am sharing the entire OneDrive directory. There are two folders that require password access, namely Secret 1 (pw=Demo) and Secret 2 (Take-a-guess). Note that they all have spaces and other symbols, and are case-sensitive (to avoid possible errors).

image