I\'m trying to get the Spotify API working with AngularJS. I\'m getting an invalid redirect URI error at the authorization stage (https://developer.spotify.com/web-api/autho
There are several ways you can do it. I recommend you to have a look at the possan/webapi-player-example, which is built using AngularJS and uses a PostMessage
to communicate between the redirect URI (callback.html
) and the Angular app (app.js
).
If PostMessages is not an option, you can try this:
localStorage
localStorage
the data you get back from Spotify (i.e. access_token
, refresh_token
, expires_in
).The previous flow, although a bit more complex, works well in environments such as iOS devices where it is sometimes impossible to communicate between the callback page and the "main" page properly.