in okta/AuthClient.py [0:0]
def change_password(self, state_token, old_password, new_password, relay_state=None):
"""Change a user's password during an authentication flow
:param state_token: current state token from the previous AuthResult
:type state_token: str
:param old_password: user's current password
:type old_password: str
:param new_password: user's desired password
:type new_password: str
:param relay_state: data that will persist for the lifetime of the authentication or recovery token
:type relay_state: str or None
:rtype: AuthResult
"""
request = {
'stateToken': state_token,
'oldPassword': old_password,
'newPassword': new_password,
'relayState': relay_state
}
response = ApiClient.post_path(self, '/credentials/change_password', request)
return Utils.deserialize(response.text, AuthResult)