Announcements

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

Invalid redirect URI after authorization

Invalid redirect URI after authorization

Plan

Premium

Country

The Netherlands

Device

Desktop PC

Operating System

Windows 11

 

My Question or Issue

Hello,

 

I am trying to show my current playing song from Spotify on my portfolio, however, after authorizing with Spotify I get the error shown in the attached image. The redirect_uri I use is registered in the developer's dashboard under my application. The only difference in my application is that it adds language codes to the URI, however, I also whitelisted these in the dashboard, and I still get the same issue.

 

I also attached a screenshot showing the whitelisted uri's in the dashboard and the route defined in laravel.

 

I hope someone has an idea of how i could solve this problem, thanks in advance.

 

invalid_redirect_uri.png
laravel_route.png
whitelisted_uris.png
Reply
5 Replies

Are you sure your website is https://portfolio.development? When I try to go to that URL, I get a ERR_NAME_NOT_RESOLVED error.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Yes, it's a virtual host from laragon and I  can go to that domain with no problems.

website.png

Sorry I'm answering late.

Can you provide some code you use for your request? The error '400 Bad Request' means there's something wrong with that.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

I am using Socialite as a driver for the authentication, here is the code at the endpoint i use to call the accounts.spotify.com/authenticate endpoint.

spotify.jpg

I can also see in devtools that it calls the /authorize endpoint and redirect to the callback uri:

Kevin_Vink_0-1662630256346.png

 

There's a problem. With Socialite, you can only get basic profile information like id, name, email, avatar and profileUrl. It doesn't support scopes or other functionalities.

You can better use one of these PHP Web API Wrappers:

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts