| 1 |
Amazon Cognito |
| 2 |
-------------- |
| 3 |
|
| 4 |
App registration (get your key and secret here) |
| 5 |
1. Go to your https://console.aws.amazon.com/cognito/ and create a Cognito User Pool if you haven't already. |
| 6 |
2. Go to General Settings > App Clients section and create a new App Client if you haven't already. Please make sure you select the option to generate a secret key. |
| 7 |
3. Go to App Integration > App Client Settings section and: |
| 8 |
|
| 9 |
1. Enable Cognito User Pool as an identity provider. |
| 10 |
2. Set the callback and sign-out URLs. (see next section for development callback URL) |
| 11 |
3. Enable Authorization Code Grant OAuth flow. |
| 12 |
4. Select the OAuth scopes you'd like to allow. |
| 13 |
|
| 14 |
4. Go to App Integration > Domain Name section and create a domain prefix for your Cognito User Pool. |
| 15 |
|
| 16 |
Development callback URL: |
| 17 |
http://localhost:8000/accounts/amazon-cognito/login/callback/ |
| 18 |
|
| 19 |
In addition, you'll need to specify your user pool's domain like so: |
| 20 |
|
| 21 |
.. code-block:: python |
| 22 |
|
| 23 |
SOCIALACCOUNT_PROVIDERS = { |
| 24 |
'amazon_cognito': { |
| 25 |
'DOMAIN': 'https://<domain-prefix>.auth.us-east-1.amazoncognito.com', |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
Your domain prefix is the value you specified in step 4 of the app registration process. |
| 30 |
If you provided a custom domain such as accounts.example.com provide that instead. |