Add middleware and settings for basic authentication and locale.