Allow using all auth types by default, and also making authentication optional

Can we refactor all the `$has_auth` logic into:

```php
if (!empty($auth_plugins)) {
  // Set the "optional" flag of the authentication manager.
  $handler->getAuthenticationManager()->setIsOptional($plugin['authentication_optional']);
}
```

But I don't get why we need the check, couldn't we just set it anyways?