Announcements

Help Wizard

Step 1

NEXT STEP

reCaptcha throwing uncaught (in promise) null error when using Spotify accounts API locally

Solved!

reCaptcha throwing uncaught (in promise) null error when using Spotify accounts API locally

Plan

Premium

Country

United Kingdom (England)

 

Device

MacBook Pro (Retina, Mid 2012)

Operating System

macOS Catalina 10.15.7

 

My Question or Issue

Hi,

 

I've recently started using the Spotify API and have followed these guides in order to get my app set up: https://developer.spotify.com/documentation/web-api/quick-start/ & https://developer.spotify.com/documentation/general/guides/authorization-guide/

 

I'm correctly firing off a request to the accounts API and being given the option to sign in:

4chfkz_w0-11a_0-1602427441654.png

 

However I get this instead of a reCaptcha:

4chfkz_w0-11a_1-1602427484078.png

 

And this is the error that gets thrown when I try and log in:

4chfkz_w0-11a_2-1602427569163.png

 

I also tried using ngrok so that it wouldn't use localhost as the domain for the reCaptcha but that also didn't work.

 

Is there a way to disable the reCaptcha? Such as some kind of development mode? Or are there specific development environment APIs that I should be using?

 

Thanks!

Reply

Accepted Solutions
Marked as solution

Hey @bonkie, help's here!

For security reasons, it's not possible to disable ReCaptcha on the Spotify login page. Your authorization flow is not supported at this moment.

 

The user sign-in part of the authorization should always be done on the authorize-endpoint of the accounts service (https://accounts.spotify.com/authorize) and can't take place on your own server/domain. After successful authentication, you can redirect back to the pre-defined 'callback'-uri of your app where you'll receive the token you can use to access the API with.

 

Let me know if you have any further questions!

 

Have a good one,

Hubo

HuboSpotify 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.

View solution in original post

2 Replies
Marked as solution

Hey @bonkie, help's here!

For security reasons, it's not possible to disable ReCaptcha on the Spotify login page. Your authorization flow is not supported at this moment.

 

The user sign-in part of the authorization should always be done on the authorize-endpoint of the accounts service (https://accounts.spotify.com/authorize) and can't take place on your own server/domain. After successful authentication, you can redirect back to the pre-defined 'callback'-uri of your app where you'll receive the token you can use to access the API with.

 

Let me know if you have any further questions!

 

Have a good one,

Hubo

HuboSpotify 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.

Hi Hubo,

 

Thanks for getting back to me. I clocked that I was attempting to access the authorisation page incorrectly and managed to fix this myself. Instead of redirecting my frontend page location to it I was attempting to serve it from my backend which was what was breaking it.

 

I'll mark your answer as correct because it's spot on and exactly what I was doing wrong.

Suggested posts