diff --git a/allauth/socialaccount/providers/pinterest/views.py b/allauth/socialaccount/providers/pinterest/views.py index 90839e46a4..c3f2b4c024 100644 --- a/allauth/socialaccount/providers/pinterest/views.py +++ b/allauth/socialaccount/providers/pinterest/views.py @@ -32,6 +32,10 @@ class PinterestOAuth2Adapter(OAuth2Adapter): profile_url = "https://{0}/{1}/user_account".format( provider_base_url, provider_api_version ) + elif provider_api_version == "v3": + profile_url = "https://{0}/{1}/users/me".format( + provider_base_url, provider_api_version + ) else: profile_url = "https://{0}/{1}/me".format( provider_base_url, provider_api_version diff --git a/docs/providers.rst b/docs/providers.rst index 7874212a81..a5d1b8fd28 100644 --- a/docs/providers.rst +++ b/docs/providers.rst @@ -1689,26 +1689,39 @@ Pinterest The Pinterest OAuth2 documentation: + # v1 # has been deprecated https://developers.pinterest.com/docs/api/overview/#authentication + # v3 # plan to enforce an end of life on June 30, 2023. + https://developers.pinterest.com/docs/redoc/#section/User-Authorization + + # v5 + https://developers.pinterest.com/docs/getting-started/authentication/ + You can optionally specify additional permissions to use. If no ``SCOPE`` -value is set, the Pinterest provider will use ``read_public`` by default. +value is set, the Pinterest provider will use reading scope by default. .. code-block:: python SOCIALACCOUNT_PROVIDERS = { 'pinterest': { - 'SCOPE': [ - 'read_public', - 'read_relationships', - ] + 'SCOPE': ['user_accounts:read'], + "PINTEREST_VERSION": "v5", } } SCOPE: For a full list of scope options, see + + # v1 https://developers.pinterest.com/docs/api/overview/#scopes + # v3 + https://developers.pinterest.com/docs/redoc/#section/User-Authorization/OAuth-scopes + + # v5 + https://developers.pinterest.com/docs/getting-started/scopes/ + Pocket -------------