pythonapioauth-2.0rauth

Rauth Library Changes - Python


I'm having a hard time with the changes made to the Rauth library and I was wondering of anybody could help.

First I create a Rauth wrapper as such (this is merely an example, not my actual code):

service = OAuth2Service(
           name='example',
           client_id='123',
           client_secret='456',
           access_token_url='https://example.com/token',
           authorize_url='https://example.com/authorize',
           base_url='https://example.com/api/')

I then do the authorization correctly and it returns a token, I then use that access_token to make a session. The access token is present, I checked.

session = service.get_session(token['access_token'])

Problem is that when I got to make a query, I get back that my session is invalid.

self.session.get(some url, params = self.params, timeout = 30.0).content)

self.params = {'Authorization': 'Bearer ' + self.access_token}

I'm not sure if I'm using the library right with the new changes. Any ideas? I also don't know how to check if a session is valid or not, so that could help too.


Solution

  • For those of you looking for help migrating to rauth 0.5.x, please refer to the upgrade guide.