firebase / firebase/functions-samples

I have created an app which works with my own Spotify account, however it does not work for other users

Open
#610 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
3.8k
Avg merge
3d 23h
Merged PRs (30d)
1

Description

### How to reproduce these conditions
Visit the URL here: https://spotifyauth-cad4c.firebaseapp.com/
^This is the hosted login page for my Google Assistant app which uses the Spotify Auth template.

Then try to sign in. For me, on my own Spotify account, after I enter my username and password it signs me in with no problem. But for other users, you included, it will be in an endless 'Please Wait' state. This means that users can never sign in and this is proved by following the advice below to use my Google assistant app.

To try to use my app, visit this link and click 'send to device' : https://assistant.google.com/services/a/uid/00000096e92c62db
As you will notice, it works for giving users a song (just using the Firebase api) and it works giving a songs audio analysis (using Spotify's getAudioAnalysis API), but when it comes to playing the song (using SPotify's playAudio API) it will not work on your spotify account. It only works on my Spotify account's open application. This proves that other users' accounts are not actually connected, instead only my account is connected.

**Failing Function code used (including require/import commands at the top)**
The failing function code is therefore this below:
const SpotifyWebApi = require('spotify-web-api-node');
const Spotify = new SpotifyWebApi({
clientId: functions.config().spotify.client_id,
clientSecret: functions.config().spotify.client_secret,
redirectUri: `https://${process.env.GCLOUD_PROJECT}.firebaseapp.com/popup.html`
});

However it is not the function code that is at fault, more just the aspect of the user having to have their own client id and credentials. This suggests that, to use any app linked with Spotify, **every single user must set up an app on Spotify's developer dashboard** - this surely can't be the case can it? This seems like a very narrow sighted way to allow for connectivity between apps.

### Expected behavior

That every user can link their Spotify account to my Google Assistant app without first setting up their own Spotify app on the Spotify Developer console.
### Actual behavior

Users cannot log in using my Spotify app's client credentials meaning they are unable to play music via their own Spotify account.

I cant find any information on this - please tell me if there is anything obvious I am missing or even if this is how it has always been!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.