[GH-ISSUE #236] Uncaught SpotifyWebAPI\SpotifyWebAPIAuthException: Invalid redirect URI #171

Closed
opened 2026-02-27 19:26:25 +03:00 by kerem · 1 comment
Owner

Originally created by @Klubuntu on GitHub (Oct 29, 2021).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/236

I'm try to use api token from

https://github.com/jwilsson/spotify-web-api-php/blob/main/docs/examples/access-token-with-authorization-code-flow.md

Unfortunately, it doesn't work well because it gets such and get this error

Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIAuthException: Invalid redirect URI in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php:56 Stack trace: #0 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(244): SpotifyWebAPI\Request->handleResponseError('{"error":"inval...', 400) #1 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(112): SpotifyWebAPI\Request->send('POST', 'https://account...', 'client_id=48f0c...', 'HTTP/2 400 \r\nda...') #2 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Session.php(250): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array) #3 D:\Software\Development\XAMPP\htdocs\spotif\auth\app\check.php(26): SpotifyWebAPI\Session->requestAccessToken('AQA9X84L0SDucXG...', 'a86937efa85589a...') #4 {main} thrown in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 56

I checked if the Redirect URI agrees in the Spotify Console and everything is set the same, what can i can change?

Originally created by @Klubuntu on GitHub (Oct 29, 2021). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/236 I'm try to use api token from https://github.com/jwilsson/spotify-web-api-php/blob/main/docs/examples/access-token-with-authorization-code-flow.md Unfortunately, it doesn't work well because it gets such and get this error **`Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIAuthException: Invalid redirect URI in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php:56 Stack trace: #0 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(244): SpotifyWebAPI\Request->handleResponseError('{"error":"inval...', 400) #1 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(112): SpotifyWebAPI\Request->send('POST', 'https://account...', 'client_id=48f0c...', 'HTTP/2 400 \r\nda...') #2 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Session.php(250): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array) #3 D:\Software\Development\XAMPP\htdocs\spotif\auth\app\check.php(26): SpotifyWebAPI\Session->requestAccessToken('AQA9X84L0SDucXG...', 'a86937efa85589a...') #4 {main} thrown in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 56`** I checked if the Redirect URI agrees in the Spotify Console and everything is set the same, what can i can change?
kerem 2026-02-27 19:26:25 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (Oct 29, 2021):

Hey!
Try removing/adding the redirect URI again or create a brand new app. Sometimes the URIs seems to get messed up and starting over solves it. If not, come back here and post the code you're using (be sure to remove your client ID and secret) and we'll take it from there!

<!-- gh-comment-id:954950132 --> @jwilsson commented on GitHub (Oct 29, 2021): Hey! Try removing/adding the redirect URI again or create a brand new app. Sometimes the URIs seems to get messed up and starting over solves it. If not, come back here and post the code you're using (be sure to remove your client ID and secret) and we'll take it from there!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#171
No description provided.