code: @Override
      public AuthenticationService getAuthenticationService() {
          AuthenticationService service = authnService.get();
          if (service == null) {
              if (isConfigurationDefinedInFile()) {
                  String id = getEffectiveSecurityConfiguration().getAuthenticationServiceId();
                  service = getAuthenticationService(id);
              } else {
                  service = autoDetectService(KEY_AUTHENTICATION, authentication);
              }
              // remember the authentication service
              authnService.set(service);
          }
          // since the saf delegation code might be invoked from the authentication service,
          // activate the authentication service if it is available.
          if (!authorization.isEmpty()) {
              getAuthorizationService();
          }
          return service;
      }
docs: {@inheritDoc}