def resource(self): provider = settings.SANCTION_PROVIDERS[self.name] c = SanctionClient(auth_endpoint=provider['auth_endpoint'], token_endpoint=provider['token_endpoint'], resource_endpoint=provider['resource_endpoint'], client_id=provider['client_id'], client_secret=provider['client_secret']) c.refresh_token = self.refresh_token c.access_token = self.access_token c.token_expires = self.token_expires return c