Skip to the content
  1. Docs
  2. Connect your users

How the hosted sign-in works

Core + Managed TransfersGuide · 2 min
The hosted sign-in connects a user's music account to your MusicAPI account and gives you an integrationUserUUID. The flow, the ids, and the setup each service needs.

Before MusicAPI can read a user's library, the user connects their music account. The hosted sign-in does that for every service with one link. You never handle the music service's OAuth flow yourself.

  1. 01
    Your app
    Opens app.musicapi.com/{slug} with your returnUrl.
  2. 02
    Service picker
    The user picks one of the services you turned on.
  3. 03
    Music service
    The user signs in and allows access.
  4. 04
    MusicAPI callback
    The service returns to api.musicapi.com/callback/…. MusicAPI stores the tokens.
  5. 05
    Your return URL
    The user comes back with data64: the result and the integrationUserUUID.

The ids

IdWhat it namesWhere you get it
slugYour MusicAPI account, in the sign-in URLSettings in the dashboard. Yours is {slug}.
authModel.uuidOne sign-in attemptThe callback
integrationUserUUIDOne connected music account. Every library call uses it.The callback
integrationUserIdThe user's own id at the music serviceThe connected-user answers

Store the integrationUserUUID with your own user. One person can connect several services. Each one is its own connected user with its own uuid. When the same music account signs in again, it gets the same uuid back.

What the user sees

  • Your business name and logo on the picker and the result pages. Set both under Settings in the dashboard.
  • Only the services you turned on under Integrations. A direct service link skips the picker.
  • The consent screen of the music service, for your developer app or for the MusicAPI managed app.

Where the tokens go

MusicAPI stores the music-service tokens encrypted, and renews them when they expire. You call the API with the integrationUserUUID, never with the service's token. If you need the raw tokens to call the service yourself, read Raw tokens and refresh.

The pages of this section

  1. Start a sign-in: build the URL and its options.
  2. Handle the callback: read data64 and check the result.
  3. Poll the sign-in status: for apps that cannot receive a redirect.
  4. Connected users: read a user and their service profile.
  5. Raw tokens and refresh.
  6. Disconnect and erase a user.

Set up each service

Each service needs an integration on your account. A transferring sign-up gets managed integrations. Otherwise, register a developer app at the service. Every page lists the callback URL to register, the scopes and the quirks.