from curl_cffi import requests
import json
for host,app in [('infoportal.baloise.de','portal_ao'),('maklerportal.baloise.de','portal_mo'),('mein-portal.baloise.de','venta')]:
 s=requests.Session(impersonate='chrome')
 h={'X-Bug-Bounty':'dwbzn'}
 r=s.get(f'https://{host}/auth/',headers=h,allow_redirects=False,timeout=20)
 csrf=s.cookies.get('CSRFT759-S',domain='.baloise.de') or next((v for k,v in s.cookies.items() if k.startswith('CSRFT')),None)
 hh={**h,'X-Same-Domain':'1','X-CSRFT759':csrf or '', 'Content-Type':'application/json','Accept':'application/vnd.api+json'}
 r=s.post(f'https://{host}/auth/rest/public/authentication/applications/{app}/access',headers=hh,data='null',allow_redirects=False,timeout=20)
 print(host,app,r.status_code,getattr(r,'toadex_exchange_id',None),r.text[:5000])
