#!/usr/bin/env python3 import hashlib import hmac import os import time import urllib.parse secret = os.getenv("OTB_PORTAL_SHARED_SECRET", "change-me") uid = os.getenv("OTB_TEST_UID", "1001") email = os.getenv("OTB_TEST_EMAIL", "client@example.com") ts = str(int(time.time())) payload = f"{uid}|{email}|{ts}".encode("utf-8") sig = hmac.new(secret.encode("utf-8"), payload, hashlib.sha256).hexdigest() params = urllib.parse.urlencode({ "uid": uid, "email": email, "ts": ts, "sig": sig, }) print(f"http://127.0.0.1:5090/auth/handoff?{params}")