complete_user_auth
Exchange OAuth2 authorization code for tokens to complete user authentication, with optional state verification to prevent CSRF attacks.
Instructions
Finish OAuth2 user auth by exchanging the authorization code for tokens.
The code is the value of the code query parameter in the URL eBay
redirected to after start_user_auth's auth_url. Optionally pass state
to verify against what start_user_auth issued (CSRF defense).
Args:
code: the authorization code from eBay's redirect URL.
state: optional — the state value from the redirect URL. If provided,
must match what start_user_auth stored. Mismatch returns a
structured refusal payload.
host: which configured host to authenticate against. Defaults to
config's default_host. Must match the host used in
start_user_auth.
Returns: On success: {host, authenticated: true, access_expires_at, refresh_expires_at} On state mismatch: {refused: true, reason: "state_mismatch", host, message: ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| state | No | ||
| host | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||