in okta/AuthClient.py [0:0]
def auth_with_factor(self, state_token, factor_id, passcode,
relay_state=None, remember_device=None):
"""Continue authentication with an MFA attempt
:param state_token: current state token from the previous AuthResult
:type state_token: str
:param factor_id: target factor id
:type factor_id: str
:param passcode: passcode required for authenticating the factor
:type passcode: str
:param relay_state: data that will persist for the lifetime of the authentication or recovery token
:type relay_state: str or None
:param remember_device: whether to remember this device to avoid requiring MFA next time
:type remember_device: bool
:rtype: AuthResult
"""
request = {
'stateToken': state_token,
'passCode': passcode,
'relayState': relay_state
}
params = {
'rememberDevice': remember_device
}
response = ApiClient.post_path(self, '/factors/{0}/verify'.format(factor_id),
request, params=params)
return Utils.deserialize(response.text, AuthResult)