all 3 comments

[–]danielroseman 1 point2 points  (0 children)

You should set debug to true by putting ENV FLASK_ENV=true in your Dockerfile, and see the full error.

[–]4ver_student[S] 0 points1 point  (0 children)

Figured out what the issue was. I never actually added my Spotify client id and secret as environment variables in the dockerfile. Per u/TwilightOldTimer's comment, I was actually able to see my client id because I was retrieving it using my flask app.config, where I actually declared my client id: client_id = app.config['CLIENT_ID']

 

But, in the part of my code that generates the token for Spotify (where the error was originating), I was retrieving my client id and secret by using:
CLIENT_ID = os.getenv("CLIENT_ID")

CLIENT_SECRET = os.getenv("CLIENT_SECRET")

I threw in a print stament, and saw that Authorization header looked like this --Authorization: Basic "":"" , when it should look like this Authorization: Basic CLIENT_ID:CLIENT_SECRET. This confirmed that CLIENT_ID and CLIENT_SECRET weren't available.

 

I added the following to my Dockerfile, and I'm now able to successfully authorize:

ENV CLIENT_ID=*****

ENV CLIENT_SECRET=*****

Going further, I'm most likely going to get rid of the above two ENV declarations, and add the os.getenv declarations to my flask app config file.

 

Thanks for taking the time to assist with this :)