SOAP-1477: Merged changes from BasicAuthenticationInspector and OAuth2AuthenticationInspector, and some refactoring