Announcements

Help Wizard

Step 1

NEXT STEP

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.

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.

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:

Suggested posts