Login with Amazon signs users in with their Amazon consumer account — a large audience for retail, media, and device-adjacent products.

## Copy the redirect URI

In the [Authdog console](https://console.authdog.com), select the project and environment, open **Authentication > Providers**, find **Amazon**, and click **Enable**. Copy the redirect URI shown in the form:

```url
https://identity.authdog.com/api/v1/callback/<connectionId>
```

## Create the security profile

1. Open the [Login with Amazon console](https://developer.amazon.com/loginwithamazon/console/site/lwa/overview.html) and create a **Security Profile**.
2. Fill in the name, description, and privacy policy URL.
3. Under **Web Settings**, add your site to **Allowed Origins**.
4. Add the redirect URI from Authdog under **Allowed Return URLs**.
5. Copy the **Client ID** and **Client Secret**.

## Configure Authdog

| Field | Value |
| --- | --- |
| **Client ID** | The client identifier from the provider |
| **Client Secret** | The client secret from the provider |

Save, then toggle the connection **active**.

## What Amazon returns

Authdog requests the `profile profile:user_id profile:email` scopes and reads the profile from `https://api.amazon.com/user/profile`.

The profile endpoint returns the Amazon user id, name, email, and postal code where available.

The user id is scoped to the security profile, so the same shopper gets different ids across two of your applications.

## Test it

1. Open your environment's hosted sign-in page, or link to `https://identity.authdog.com/api/v1/signin/<connectionId>`.
2. Select the Amazon button and complete the flow.
3. Confirm the user appears under **Users** in the console with a Amazon identity linked.

## Troubleshooting

| Symptom | Cause |
| --- | --- |
| `invalid_client` | Client credentials belong to another security profile |
| `invalid_scope` | The security profile does not permit the email scope |
| Redirect or callback URL error | The URI registered with the provider does not match Authdog's exactly |
| Works in one environment only | Each environment has its own `connectionId`, and so its own redirect URI to register |

## Related

| Read | To learn how to |
| --- | --- |
| [Connectors](/docs/connectors) | Set up any other social provider |
