Announcements
Happy Values Week! Today we celebrate *Inclusion* in the Spotify Stars Program!

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Spotify API redirect issue on Safari

Spotify API redirect issue on Safari

Hi all,

 

I’ve built an app using the Spotify API’s Authorization Code Flow. The app works on Firefox, Chrome, and Brave. However, I’m encountering an issue on Safari.

 

After I have successfully logged in to Spotify, instead of being redirected back to my app, I’m taken to https://accounts.spotify.com/en/status (see attached photo).

 

Has anyone else experienced this issue on Safari, or have any ideas on what might be causing it?

 

Here's the URL for my app in case anyone wanted to test it - https://listening-stats-jn.netlify.app/

 

FYI someone else asked a similar question here but there was no solution.

 

Any help would be appreciated! 

Thanks,

Jacob

Screenshot 2024-08-27 at 17.59.12.png
Reply
5 Replies

Hi! Did you find a solution for this? I'm currently facing the same issue with the authentication flow on Safari

Also would like an answer to this problem. Experiencing it myself.

We're seeing the same exact issue for private safari browser

The Spotify API redirect issue on Safari is likely due to Safari’s ITP (Intelligent Tracking Prevention), which blocks third-party cookies and can interfere with OAuth authentication.

To resolve this issue in your API development, consider:

1️⃣ Ensure the Redirect URI is Whitelisted – Double-check that the redirect URI is correctly registered in your Spotify Developer Dashboard.

2️⃣ Use SameSite=None; Secure for Cookies – If your authentication relies on cookies, ensure they are properly set for cross-site requests.

3️⃣ Enable PKCE Flow for Authentication – This improves security and helps prevent issues with Safari’s privacy restrictions.

4️⃣ Use an In-App Browser or Alternative Authentication – If the issue persists, try handling authentication via a different browser or embedded web view.

Have you checked Safari’s developer console (Cmd + Option + I) for any CORS or cookie-related errors? Let us know what you find!

Hi, here's a simple summary of the problem. First, we open the Spotify authentication page. Next, the user logs in to Spotify. Finally, Spotify should redirect back to the redirect uri we specified. The final part works in all browsers except private safari, which doesn't redirect on mobile or desktop. If you're already logged in then the redirect works.

 

#1 The uri is whitelisted since it works properly when not using private mode in a safari browser.

 

#2 Our cookies are using the specified value, but this appears unrelated (at least on our side) since Spotify doesn't redirect back to our website.

 

#3 We didn't attempt this, but I believe this shouldn't have an impact either because the only part not working is Spotify redirecting the page back to us.

 

#4 Yes, we're supporting in-app authentication as well. However, if a user is on a desktop mac then the mobile app isn't an option.

 

I didn't see any noticeable errors in the developer console.

 

Thanks

Suggested posts