@classmethod
def _deriveLogin(cls, email, firstName, lastName, userName=None):
    """
        Attempt to automatically create a login name from existing user
        information from OAuth2 providers. Attempts to generate it from the
        username on the provider, the email address, or first and last name. If
        not possible, returns None and it is left to the caller to generate
        their own login for the user or choose to fail.

        :param email: The email address.
        :type email: str
        """
    for login in cls._generateLogins(email, firstName, lastName, userName):
        login = login.lower()
        if cls._testLogin(login):
            return login
    raise Exception('Could not generate a unique login name for %s (%s %s)' %
        (email, firstName, lastName))
