processUser(user) {
    return GoogPromise.resolve().then(() => {
      const apiKey = this.signedInAuth_ &&
        this.signedInAuth_['app']['options']['apiKey'];
      if (!this.configs_.hasOwnProperty(apiKey)) {
        throw new Error('Invalid project configuration: API key is invalid!');
      }
      this.configs_[apiKey].validateTenantId(
          user['tenantId'] || UiHandlerConfig.ConfigKeys.TOP_LEVEL_CONFIG_KEY);
      if (!this.signedInAuth_['currentUser'] ||
          (this.signedInAuth_['currentUser']['uid'] !== user['uid'])) {
        throw new Error(
            'The user being processed does not match the signed in user!');
      }
      const beforeSignInSuccessCallback =
          this.configs_[apiKey].getBeforeSignInSuccessCallback();
      return beforeSignInSuccessCallback ?
          beforeSignInSuccessCallback(user) : user;
    }).then((processedUser) => {
      // Checks that the user returned in callback has to be same as the
      // original one.
      if (processedUser['uid'] !== user['uid']) {
        throw new Error('User with mismatching UID returned.');
      }
      return processedUser;
    });
  }
Handles additional processing on the user if callback is provided by the
developer.
@param {!firebase.User} user The signed in user to be processed.
@return {!GoogPromise<!firebase.User>} A promise that resolves when the
    processing is finished.
@override