DEV Community

Cover image for Spotify Authentication using Client(React) and Server(ExpressJs)

Spotify Authentication using Client(React) and Server(ExpressJs)

Dipesh Jaiswal on April 27, 2021

Hey gorgeous reader, In this blog, I will demonstrate how to implement Spotify Authentication and retrieving Users' Data with ReactJs and Express...
Collapse
 
wlhmmxrtz profile image
Moritz • Edited

amazing job!
I tried to insert the accessToken into a spotify web player, this however triggers an infinite reload
`import logo from "./logo.png";
import "./App.css";
import SpotifyPlayer from "react-spotify-web-playback";
import React from "react";
import "./App.css";
import Login from "./Login";
import Dashboard from "./Dashboard"
import {useAuth} from "./useAuth"

const code = new URLSearchParams(window.location.search).get('code')

function App() {
const accessToken = useAuth(code).accessToken;
return (




{code ? : }
logo




className="App-spotify-player"
token={accessToken}
uris={["spotifyπŸ§‘β€πŸŽ¨5K4W6rqBFWDnAN6FQUkS6x"]}
styles={{
activeColor: '#fff',
bgColor: '#faebd7',
color: '#000000',
loaderColor: '#FDB9F8',
sliderColor: '#FDB9F8',
trackArtistColor: '#FDB9F8',
trackNameColor: '#000000',
}}
/>



);
}

export default App;
`

Would be nice if you could help me out
Image description

Collapse
 
harsh2000hp profile image
harsh2000hp

Nice work.

Collapse
 
dipeshjaiswal profile image
Dipesh Jaiswal

Thanks, @harsh2000hp 😁

Collapse
 
xorlieh99new profile image
Xorlieh99-new

Hi there, I was trying to do what you did here and everything has been okay until the last step. I am not getting the user's details it says invalid access token, can you help?

Collapse
 
harrisonshort profile image
Harrison Short

I had the same issue, which was being caused by the presence of React.StrictMode tags in my index.js file.

Collapse
 
cashcold profile image
CashCold

Useful
Thank you Sir

Collapse
 
quinntoncarter profile image
Q

Thank you!

Collapse
 
leonardokaprio profile image
Tariq Mehmood

This is great post for Spotify lovers, if you wan to get our post then you can download Spotify Premium APK.

Collapse
 
shaheenbi3 profile image
Shaheen Bi

If you want to download our post Spotify MOD APK

Collapse
 
ralphmurphy profile image
Ralph Murphy • Edited

The upgraded version of spotify is only available at Spotify Premium MODHEHE, where you can download the application for free, the latest version is continuously updated.

Collapse
 
descargarapk profile image
Descargar-APK

Great article, it's very useful information! Here I share Spotify Premium APK MOD for Android.

Collapse
 
thesneyder profile image
✯ El Sneyder ✯

I have Spotify Premium free for my android.