How to use the tokendito.settings.mfa_response function in tokendito

To help you get started, we’ve selected a few tokendito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dowjones / tokendito / tokendito / okta_helpers.py View on Github external
: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
github dowjones / tokendito / tokendito / okta_helpers.py View on Github external
"""
    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
github dowjones / tokendito / tokendito / okta_helpers.py View on Github external
: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