INNER CODE UNIT · Python
poll_for_tokens
CassiopeiaCode/q2api · account-feeder/app.py:122
async def poll_for_tokens(
client_id: str,
client_secret: str,
device_code: str,
interval: int,
expires_in: int,
max_timeout_sec: int = 300,
) -> Dict:
"""轮询获取 tokens"""
payload = {
"clientId": client_id,
"clientSecret": client_secret,
"deviceCode": device_code,
"grantType": "urn:ietf:params:oauth:grant-type:device_code",
}
import time