| 1 |
SoundCloud |
| 2 |
---------- |
| 3 |
|
| 4 |
SoundCloud allows you to choose between OAuth1 and OAuth2. Choose the latter. |
| 5 |
|
| 6 |
App registration (get your key and secret here) |
| 7 |
http://soundcloud.com/you/apps/new |
| 8 |
|
| 9 |
Development callback URL |
| 10 |
http://example.com/accounts/soundcloud/login/callback/ |
| 11 |
|
| 12 |
|
| 13 |
ID to URN Migration |
| 14 |
^^^^^^^^^^^^^^^^^^^ |
| 15 |
|
| 16 |
Mid 2025, Soundcloud migrated away from using IDs for user accounts to URNs, |
| 17 |
see: https://developers.soundcloud.com/blog/urn-num-to-string |
| 18 |
|
| 19 |
Therefore, starting from 65.10.0, the allauth provider now uses the user ``urn`` |
| 20 |
instead of the ``id`` as the ID for social accounts. If you have SoundCloud |
| 21 |
already up and running, and are migration to allauth 65.10.0 or higher, you will |
| 22 |
have to address this breaking change. Consider migrating existing Soundcloud |
| 23 |
SocialAccount records manually, for example, using:: |
| 24 |
|
| 25 |
from django.db.models import F, Value |
| 26 |
from django.db.models.functions import Concat |
| 27 |
|
| 28 |
from allauth.socialaccount.models import SocialAccount |
| 29 |
|
| 30 |
|
| 31 |
SocialAccount.objects.filter( |
| 32 |
provider="soundcloud" |
| 33 |
).exclude( |
| 34 |
uid__startswith="soundcloud:users:" |
| 35 |
).update( |
| 36 |
uid=Concat(Value("soundcloud:users:"), F("uid")) |
| 37 |
) |