import logging


def get_mfa_response(mfa_result):
    """Extract json from mfa response.

    :param mfa_result: raw response from mfa api
    :return verify_mfa: json response from mfa api
    """
    try:
        verify_mfa = mfa_result.json()["response"]
    except Exception as parse_error:
        logging.error(
            "There was an error parsing the mfa challenge result: \n{}".format(parse_error))
        exit(1)
    return verify_mfa