code: function () {
                  deferred = $q.all(authProviders.map(function (provider) {
                      return provider.deauthenticate();
                  }).concat(deferred === null ? [] : [deferred])).then(function (realms) {
                      currentSubject = null;
                      authorizationService.clear();
  
                      deferred = null;
  
                      $log.info('subject deauthenticated from realm(s): ' + realms);
  
                      /**
                       * @ngdoc event
                       * @name w20CoreSecurity.service:AuthenticationService#w20\.security\.deauthenticated
                       * @eventOf w20CoreSecurity.service:AuthenticationService
                       * @eventType emitted on root scope
                       * @param {String} id The deauthenticated subject identifier.
                       * @param {Boolean} The subject is cleanly deauthenticated.
                       *
                       * @description
                       *
                       * This event is emitted after the subject deauthentication.
                       *
                       */
                      eventService.emit('w20.security.deauthenticated', true);
  
                      return true;
                  }, function (realms) {
                      currentSubject = null;
                      authorizationService.clear();
  
                      deferred = null;
  
                      $log.error('subject failed to deauthenticate from realm(s): ' + realms);
  
                      eventService.emit('w20.security.deauthenticated', false);
                  });
  
                  return deferred;
              }
docs: @ngdoc function
  @name w20CoreSecurity.service:AuthenticationService#deauthenticate
  @methodOf w20CoreSecurity.service:AuthenticationService
  @returns {Object} A promise that will be resolved upon successful subject deauthentication, or rejected otherwise.
  
  @description
  
  Deauthenticate the currently authenticated subject.