old_contents: from allauth.socialaccount import providers
  from allauth.socialaccount.providers.base import ProviderAccount
  from allauth_cas.providers import CASProvider
  
  
  class TUIDAccount(ProviderAccount):
      pass
  
  
  class TUIDProvider(CASProvider):
      id = 'tuid'  # Choose an identifier for your provider
      name = 'TU-ID CAS Provider'  # Verbose name of your provider
      account_class = TUIDAccount
  
  
  providers.registry.register(TUIDProvider)
  
new_contents: from allauth.socialaccount import providers
  from allauth.socialaccount.providers.base import ProviderAccount
  from allauth_cas.providers import CASProvider
  
  
  class TUIDAccount(ProviderAccount):
      pass
  
  
  class TUIDProvider(CASProvider):
      id = 'tuid'  # Choose an identifier for your provider
      name = 'TU-ID CAS Provider'  # Verbose name of your provider
      account_class = TUIDAccount
  
      def extract_uid(self, data):
          return str(data[1]['cn'])
  
      def extract_common_fields(self, data):
          return dict(username=data[1]['cn'],
                      email=data[1].get('mail', ''),
                      first_name=data[1].get('givenName', ''),
                      last_name=data[1].get('surname', ''), )
  
  providers.registry.register(TUIDProvider)
  
subject: Add field mapping to tuid provider