Consent is void if it is obtained by the undue exercise of any official, parental, or other authority; and if such authority is exercised otherwise than in good faith for the purposes for which it is allowed by law.