in okta/UsersClient.py [0:0]
def expire_password(self, uid, temp_password=False):
"""Expire user's password by target user id
:param uid: the target user id
:type uid: str
:param temp_password: whether a temporary password should be set
:type temp_password: bool
:return: None or TempPassword
"""
if not temp_password:
response = ApiClient.post_path(self, '/{0}/lifecycle/expire_password'.format(uid))
else:
params = {
'tempPassword': temp_password
}
response = ApiClient.post_path(self, '/{0}/lifecycle/expire_password'.format(uid), params=params)
return Utils.deserialize(response.text, TempPassword)