# Authentication

## How it works

IDC uses eBay's standard authorization process. When you connect, you give IDC permission to act on your eBay account. eBay generates an Authorization Code, which IDC exchanges for an Access Token. IDC then stores a longer-lived Refresh Token that it uses to renew access automatically whenever the Access Token expires. This way, you authorize once and IDC stays connected without needing you to re-enter credentials.

## When credentials expire

The Authorization Code itself is short-lived and is used only once during setup. After that, IDC renews the connection using the Refresh Token automatically in the background. As long as you don't revoke IDC's permission in your eBay account, the Refresh Token won't expire and IDC will stay connected indefinitely.

IDC monitors the Refresh Token expiration date. If the token is set to expire and renewal fails, you'll see a connection error in the eBay app status.

## Re-authorizing

If the connection breaks (for example, if you revoke access in eBay or if the Refresh Token expires), follow these steps to reconnect:

1. In the IDC dashboard, click **Apps**, then **eBay**.
2. Click the **Credentials** tab.
3. Clear the **Refresh Token** and **Refresh Token Expiration** fields.
4. Generate a new **Authorization Code** from eBay's authorization page.
5. Paste the new code into the **Authorization Code** field.
6. Click **Save**.

IDC will exchange the new code for a Refresh Token and reconnect automatically.

## Common authentication issues

| Symptom                                    | What to try                                                                                                       |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| Connection shows as Failed                 | Check that your Client ID and Client Secret are correct and have not been revoked in your eBay Developer account. |
| "Invalid Authorization Code" error         | The code may have expired. Go back to eBay and generate a fresh Authorization Code.                               |
| Connection keeps dropping                  | Check in eBay that you haven't revoked IDC's permission. If you did, re-authorize using the steps above.          |
| Refresh Token Expiration shows in the past | The token has expired. Clear it, generate a new Authorization Code, and save again.                               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.in8sync.com/idc/ebay/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
