'Return this user\'s nickname.
The nickname will be a unique, human readable identifier for this user
with respect to this application. It will be an email address for some
users, part of the email address for some users, and the federated identity
for federated users who have not asserted an email address.'

def nickname(self):

    if (self.__email and self.__auth_domain and self.__email.endswith(('@' + self.__auth_domain))):
        suffix_len = (len(self.__auth_domain) + 1)
        return self.__email[:(- suffix_len)]
    elif self.__federated_identity:
        return self.__federated_identity
    else:
        return self.__email
