Ejemplo n.º 1
0
    def retrieve_access_token(self, oauth_request_token):
        """Make the API call to retrieve an accesstoken
        Object returned is an OAuthAccessToken
        """
        response = self.do_method("auth.accesstoken", {}, oauth_request_token)

        token = OAuthAccessToken(
                response['oauth_token'],
                response['oauth_token_secret'],
                response['userid'],
                )

        token.methods = response['methods']
        token.expiredate = response['expiredate']

        return token
Ejemplo n.º 2
0
    def retrieve_access_token_by_login(self, token):
        """Get a nice oauth token based on a logintoken
        """
        response = self.do_method(
            'auth.accesstokenByLogintoken',
            {
                'logintoken': token,
            }
        )

        token = OAuthAccessToken(
            response['oauth_token'],
            response['oauth_token_secret'],
            response['userid'],
        )

        token.methods = response['methods']
        token.expiredate = response['expiredate']

        return token