Finish authorization (non-localhost callback)
exchange_codeCompletes Withings OAuth by exchanging a redirected URL or authorization code for tokens saved to a local file, enabling CLI authorization when the callback isn't localhost.
Instructions
Finishes the one-time authorization when the callback URL is not on localhost: pass the full URL the browser was redirected to (or just its code). Withings codes expire after 30 seconds and work once, so the CLI (node server/cli.mjs authorize) is easier. Saves the tokens to the local token file (chmod 600); never returns them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| redirect_url_or_code | Yes | The URL you were redirected to (contains ?code=...&state=...), or the code itself. |