Clean up what is the top-level autoconfiguration class.

Add additional checks of accessing a secured endpoint.