def _get_token ( self , oauth_request , token_type = 'access' ) : token_field = oauth_request . get_parameter ( 'oauth_token' ) token = self . data_store . lookup_token ( token_type , token_field ) if not token : raise OAuthError ( 'Invalid %s token: %s' % ( token_type , token_field ) ) return token
how to get an oauth2 access token from python
Try to find the token for the provided request token key .
def _get_token(self, oauth_request, token_type='access'):
        """Try to find the token for the provided request token key."""
        token_field = oauth_request.get_parameter('oauth_token')
        token = self.data_store.lookup_token(token_type, token_field)
        if not token:
            raise OAuthError('Invalid %s token: %s' % (token_type, token_field))
        return token