code: def get_username(self, claims):
          
          # bluntly stolen from django-browserid
          # https://github.com/mozilla/django-browserid/blob/master/django_browserid/auth.py
          username_algo = self.get_settings('OIDC_USERNAME_ALGO', None)
  
          if username_algo:
              if isinstance(username_algo, six.string_types):
                  username_algo = import_string(username_algo)
              return username_algo(claims.get('email'))
  
          return default_username_algo(claims.get('email'))
docs: Generate username based on claims.