When connecting via Oauth2 to Yandex.Disk, I get an error - UnauthorizedError.
I filled out everything as described.
Please help with authorization.
Thank you.
What is the error message (if any)? UnauthorizedError
Please share the workflow
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
Share the output returned by the last node
<!-- {"status":"rejected","reason":{"message":"401 - {\"message\":\"Не авторизован.\",\"description\":\"Unauthorized\",\"error\":\"UnauthorizedError\"}","name":"Error","stack":"Error: Request failed with status code 401\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"}} -->
It looks like Yandex is not happy with the credentials being used, Looking at your OAuth credential screenshot you don’t have any scopes set. Does Yandex not require any?
Good afternoon, Jon. Scopes are required, but they are already provided to the application.
If I connect using a debug token, i.e. manually insert it into the request, the request passes.
There must be some problem with getting the token itself in Credential.
I suspect the debug token is already authenticated using the scopes required which is why that works. Can you add the scopes to the credential and see if that helps, Normally just adding scopes to the application isn’t enough and the application authenticating also needs to confirm what scopes will be needed for the user authenticating but it could be that Yandex doesn’t work that way.
Does Yandex need anything anything else special when authenticating like an additional header to be sent? I am not aware of any issues with the OAuth implementation at the moment so I suspect it is going to be something Yandex specific.
That is interesting, They mention on that page that they expect Authorization: OAuth xxxyyyzzz but we send Authorization: Bearer xxxyyyzzz I wonder if they only support that header value or if they support bearer as well