Okta API Python SDK - 激活用户时出错

Okta API Python SDK - Error activating a user

我正在关注 Okta Python SDK 文档1。我成功地创建了一个用户。但是,当我尝试激活它时,我看到以下错误。我已通过 REST API 验证用户确实存在。

>>> usersClient.activate_user(user)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/shetty/work/django/pyenv/lib/python2.7/site-packages/okta/UsersClient.py", line 129, in activate_user
    response = ApiClient.post_path(self, '/{0}/lifecycle/activate'.format(uid))
  File "/Users/shetty/work/django/pyenv/lib/python2.7/site-packages/okta/framework/ApiClient.py", line 74, in post_path
    return self.post(self.base_url + url_path, data, params)
  File "/Users/shetty/work/django/pyenv/lib/python2.7/site-packages/okta/framework/ApiClient.py", line 53, in post
     if self.__check_response(resp, attempts):
  File "/Users/shetty/work/django/pyenv/lib/python2.7/site-packages/okta/framework/ApiClient.py", line 88, in __check_response
    raise OktaError(json.loads(resp.text))
OktaError: Not found: Resource not found: <okta.models.user.User.User instance at 0x10a432050> (User)

传入用户的id即可成功激活用户。

from okta.models.user import User

user = User(login='example@example.com',
            email='example@example.com',
            firstName='Saml',
            lastName='Jackson')

user = usersClient.create_user(user, activate=False)

usersClient.activate_user(user.id)
# <okta.models.user.User.User instance at 0x101cc1908>