| 1 |
Shopify |
| 2 |
------- |
| 3 |
|
| 4 |
The Shopify provider requires a ``shop`` parameter to login. For |
| 5 |
example, for a shop ``petstore.myshopify.com``, use this:: |
| 6 |
|
| 7 |
/accounts/shopify/login/?shop=petstore |
| 8 |
|
| 9 |
You can create login URLs like these as follows: |
| 10 |
|
| 11 |
.. code-block:: python |
| 12 |
|
| 13 |
{% provider_login_url "shopify" shop="petstore" %} |
| 14 |
|
| 15 |
For setting up authentication in your app, use this url as your ``App URL`` |
| 16 |
(if your server runs at localhost:8000):: |
| 17 |
|
| 18 |
http://localhost:8000/accounts/shopify/login/ |
| 19 |
|
| 20 |
And set ``Redirection URL`` to:: |
| 21 |
|
| 22 |
http://localhost:8000/accounts/shopify/login/callback/ |
| 23 |
|
| 24 |
**Embedded Apps** |
| 25 |
|
| 26 |
If your Shopify app is embedded you will want to tell allauth to do the required JS (rather than server) redirect.:: |
| 27 |
|
| 28 |
SOCIALACCOUNT_PROVIDERS = { |
| 29 |
'shopify': { |
| 30 |
'IS_EMBEDDED': True, |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
Note that there is more an embedded app creator must do in order to have a page work as an iFrame within |
| 35 |
Shopify (building the x_frame_exempt landing page, handing session expiration, etc...). |
| 36 |
However that functionality is outside the scope of django-allauth. |
| 37 |
|
| 38 |
**Online/per-user access mode** |
| 39 |
Shopify has two access modes, offline (the default) and online/per-user. Enabling 'online' access will |
| 40 |
cause all-auth to tie the logged in Shopify user to the all-auth account (rather than the shop as a whole).:: |
| 41 |
|
| 42 |
SOCIALACCOUNT_PROVIDERS = { |
| 43 |
'shopify': { |
| 44 |
'AUTH_PARAMS': {'grant_options[]': 'per-user'}, |
| 45 |
} |
| 46 |
} |