INNER CODE UNIT · Python
start_device_authorization
CassiopeiaCode/q2api · account-feeder/app.py:110
async def start_device_authorization(client_id: str, client_secret: str) -> Dict:
"""开始设备授权流程"""
payload = {
"clientId": client_id,
"clientSecret": client_secret,
"startUrl": START_URL,
}
r = await post_json(DEVICE_AUTH_URL, payload)
r.raise_for_status()
return r.json()
async def poll_for_tokens(
client_id: str,
client_secret: str,
device_code: str,
interval: int,
expires_in: int,