Skip to main content

Initializing User Authentication

Prerequisites

This guide assumes you have already configured your music service integrations in the Developer Dashboard.

Basic Authentication Flow

To initiate the user authentication process, redirect users to the following URL structure:

Example Implementation: If your account slug is sanreh and you want users to return to https://sanreh.com/callback:

Users will then be presented with a list of configured music services to choose from. After completing authentication (whether successful or failed), they will be redirected to your specified return URL.

Return URL Configuration

Ensure your return URL is added to the list of accepted URLs in your Developer Dashboard for security purposes.

Service-Specific Authentication

For enhanced user experience, you may want to direct users to authenticate with a specific music service (for example, when displaying service-specific buttons in your application interface).

Use the following URL structure to bypass service selection:

Example Implementation: To direct users specifically to Apple Music authentication:

Replace musicService with any of the supported services.

Service Bypass Behavior

Pre-selecting a service bypasses the "enabled/disabled" settings in your dashboard. Even if you've disabled certain integrations in your dashboard, they will still function when users are directed to them via direct URLs.

Authentication Flow Preview

Test the authentication flow using the interactive preview below:

Or test with Spotify pre-selected:

Customization

The branding and logos shown in the authentication flow are fully customizable through your Developer Dashboard.

Advanced Configuration Options

Enhance your authentication flow with these optional parameters:

  • Error Forwarding: Add forwardFailures=true to redirect users back to your return URL immediately upon authentication errors
  • Status Polling: Pass a unique UUID v4 as uniqueId=[uuidv4()] to enable polling for authentication status updates (see related endpoint)