Invalid Client Error w/Spotify Web API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Free/Premium
Country
United States
My Question or Issue
My team and I are getting a "Invalid Client" / WebapiAuthenticationError: An authentication error occurred while communicating with Spotify's Web API error
We can confirm that we have quadruple checked the client id and client secret in our being the exact same from our dev dashboard, we can confirm that we recreated a client secret as well.
Our use case is simple, we created a cloud function via firebase that makes endpoint calls to the Spotify Web Api every 30 minutes to extract our apps user most recently played tracks from spotify. Here's a small example snippet of the begging of our code structure to reference my use case above.
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const SpotifyWebApi = require('spotify-web-api-node');
admin.initializeApp();
exports.getRecentSongs = functions.pubsub.schedule('every 30 minutes').onRun(async (context) => {
// Initialize Spotify Web API
const spotifyApi = new SpotifyWebApi({
clientId: 'myclientid',
clientSecret: 'myclientsecret'
});
(*
see e rror code screenshot attached)
(*
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page