cenkalti / putio.py

A python wrapper for put.io APIv2
http://put.io
MIT License
72 stars 41 forks source link

OAuth changes causing 401 exceptions #31

Closed datashaman closed 7 years ago

datashaman commented 7 years ago

The changes since 5.0.0 result in 401 Unauthorized responses (where authentication is used). Specifically I'm seeing it on File.upload(). File.download() still works as it did, unsure why.

I notice there is a new-ish AuthHelper class, unsure how to use it from a back-end application. I assume there's some new method of authenticating which I'm not doing correctly.

datashaman commented 7 years ago

Never mind, I see the README mentions it, I'll investigate further.

cenkalti commented 7 years ago

Okay, don't hesitate to write if you need any help.

On Thu, Jan 26, 2017 at 10:12 AM, datashaman notifications@github.com wrote:

Never mind, I see the README mentions it, I'll investigate further.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cenkalti/putio.py/issues/31#issuecomment-275321945, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoYcubP94VKzCgm0zBtaEnuujxculSkks5rWEdpgaJpZM4LuWJj .

datashaman commented 7 years ago

I'm struggling to get the Put.IO OAuth server to allow me to use it from the backend only. My app is a suite of CLI commands that run on a server. No user input is possible.

The commands were all working by using the OAuth Token listed on the app's page on Put.IO. But that stopped working a few days ago, presumably something was changed on the server.

I noticed yesterday that the OAuth Token changes: when I've left my browser on the app page and press refresh, different value. shrug that method doesn't work anymore.

Please let me know if there's a way to use your OAuth implementation from another server (using python if possible). The Internet says it's called 2-legged OAuth.

I've tried to use basic auth on the oauth2 endpoint so I can get the access token programmatically, but no dice.

Are you using a known python package for the OAuth server implementation? Any clue would help. :)

cenkalti commented 7 years ago

Hello @datashaman.

Are you using a known python package for the OAuth server implementation? Any clue would help. :)

We don't use a known Python package for the server implementation.

I noticed yesterday that the OAuth Token changes: when I've left my browser on the app page and press refresh, different value. shrug that method doesn't work anymore.

Actually, there was a bug that causes a new token to be created on page load if your IP address is different from the previous one. It is fixed now. However, the old token was still valid, you just didn't see it on the app page anymore.

If you can tell what you are trying to achieve and maybe provide a code snippet, I will be happy to help to solve the problem.