iOS Spotify SDK v3 authentication redirect issue and invalid client error

I’m working with the Spotify iOS SDK version 3 beta that I got from their GitHub repository. When I try to authenticate users, I’m running into a weird problem with the login flow.

Here’s what happens: First time I tap the login button, it opens Safari and shows the Spotify login page. After I enter my credentials and submit, Safari stays open and doesn’t redirect back to my app. Then when I manually go back to my app and try logging in again, it opens account.spotify.com in Safari and shows an error message saying “INVALID_CLIENT: Invalid redirect URL”.

Has anyone else encountered this authentication problem with the beta SDK? I’m not sure if this is a configuration issue on my end or a bug in the beta version. Any help would be appreciated.

check your info.plist for the URL scheme - it might be missing or set wrong. i had that problem too, the callback URL wasn’t registered right in the app. ensure your spotify app settings have the exact same redirect URI, no extra chars or spaces.

The INVALID_CLIENT error typically indicates a mismatch between your app’s bundle identifier and the redirect URI configured in your Spotify settings. I experienced this issue when I transitioned to the v3 beta recently. I resolved it by ensuring that my redirect URI was correctly formatted as your-bundle-id://spotify-login-callback in both the Spotify dashboard and the app settings. The beta version has stricter requirements compared to prior versions. Additionally, Safari’s authentication session can occasionally get stuck; force-closing Safari between login attempts often resolves any redirect issues.

Had the same problem with the v3 beta. Usually it’s because your redirect URI in the Spotify dashboard doesn’t match what’s in your app config - they need to be identical, including trailing slashes. Safari also loves to break the redirect back to your app during auth. I had to build a custom URL scheme handler to catch the callback properly. This beta has way more URL handling bugs than the stable v2 SDK ever did. Try clearing your app data and run the auth flow in a fresh Safari session - that’ll clear any cached redirect conflicts.