Spotify Authorization Problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Free
Country
United States
Device
(Desktop)
Operating System
(Windows 10)
My Question or Issue
Hello, I'm currently making an app on Desktop (no backend) with React where a user can see their top songs and artists. I'm using the Implicit Grant Flow Authorization model it's not working. I currently have a button that would redirect the user to the Spotify Account page where it would ask them to give my app permission to look at their data but I'm getting:
Access to XMLHttpRequest at 'https://accounts.spotify.com/authorize?client_id=undefined&redirect_uri=http://localhost:3000/callba...' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I looked online for solutions but none seem to work. I tried the anchor tag trick where you make the href the URL but I'm greeted with an invalid client error. The Cors trick would not work because I'm not using a backend. Any help would be greatly appreciated, attached is a picture with my current code (They don't allow other files). Thank you!
-Slaeh
- Labels:
-
Implicit Flow
-
javascript
-
React
-
spotify api
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page