Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:param selected_mfa_option: Selected MFA option (SMS, push, etc)
:param headers: headers
:param mfa_challenge_url: MFA challenge URL
:param payload: payload
:param primary_auth: Primary authentication method
:return: payload data
"""
logging.debug("Handle user MFA options")
logging.debug("User MFA options selected: [{}]".format(
selected_mfa_option['factorType']))
if selected_mfa_option['factorType'] == 'push':
return push_approval(headers, mfa_challenge_url, payload)
if settings.mfa_response is None:
logging.debug("Getting verification code from user.")
print('Type verification code and press Enter')
settings.mfa_response = helpers.get_input()
# time to verify the mfa method
payload = helpers.prepare_payload(
stateToken=primary_auth['stateToken'], passCode=settings.mfa_response)
mfa_verify = okta_verify_api_method(mfa_challenge_url, payload, headers)
logging.debug("mfa_verify [{}]".format(json.dumps(mfa_verify)))
return mfa_verify
"""
logging.debug("Handle user MFA options")
logging.debug("User MFA options selected: [{}]".format(
selected_mfa_option['factorType']))
if selected_mfa_option['factorType'] == 'push':
return push_approval(headers, mfa_challenge_url, payload)
if settings.mfa_response is None:
logging.debug("Getting verification code from user.")
print('Type verification code and press Enter')
settings.mfa_response = helpers.get_input()
# time to verify the mfa method
payload = helpers.prepare_payload(
stateToken=primary_auth['stateToken'], passCode=settings.mfa_response)
mfa_verify = okta_verify_api_method(mfa_challenge_url, payload, headers)
logging.debug("mfa_verify [{}]".format(json.dumps(mfa_verify)))
return mfa_verify
:param payload: payload
:param primary_auth: Primary authentication method
:return: payload data
"""
logging.debug("Handle user MFA options")
logging.debug("User MFA options selected: [{}]".format(
selected_mfa_option['factorType']))
if selected_mfa_option['factorType'] == 'push':
return push_approval(headers, mfa_challenge_url, payload)
if settings.mfa_response is None:
logging.debug("Getting verification code from user.")
print('Type verification code and press Enter')
settings.mfa_response = helpers.get_input()
# time to verify the mfa method
payload = helpers.prepare_payload(
stateToken=primary_auth['stateToken'], passCode=settings.mfa_response)
mfa_verify = okta_verify_api_method(mfa_challenge_url, payload, headers)
logging.debug("mfa_verify [{}]".format(json.dumps(mfa_verify)))
return mfa_verify