I’m doing a data engineering project, which is retrieving data using the Spotify API, I’m using this function to retrieve info about my personal account:
def get_token(**kwargs):
print(client_id, client_secret)
sp_oauth = SpotifyOAuth(client_id = client_id,
client_secret=client_secret,
redirect_uri="http://localhost:4004/",
scope="user-top-read")
token_info = sp_oauth.get_cached_token()
if token_info:
kwargs['ti'].xcom_push(key = 'token_data', value = token_info['access_token'])
else:
return None
The thing is if I run it in my local machine it works fine, it retrieves a token, but using airflow dags (in docker containers) the output is None.
I’ve tried using ngrok, but it didn’t work. Could guide me where could be the problem? Thanks in advance.
New contributor
Juan Carlos Estrella Ramirez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.