How to make author field required?
What you're looking for is this:

$form['uid']['widget'][0]['target_id']['#required'] = TRUE;

(Devel is your friend!)

You were on the right track as $form['author']['#required'] = TRUE; will make the "Authoring Information" have a red star (*), but won't make your authored by field required.

Complete code:

function hook_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form_id == 'your_form_id') {
    $form['uid']['widget'][0]['target_id']['#required'] = TRUE;
  }
}