Open janecafe opened 5 years ago
Hi, Jane.
Did you add that URI to your Spotify application under "Edit settings"?
I was getting that same error and adding it under settings to the list of authorized redirect URIs fixed it for me.
Hi, Jane.
Did you add that URI to your Spotify application under "Edit settings"?
I was getting that same error and adding it under settings to the list of authorized redirect URIs fixed it for me. @njcorona Hey, thanks for responding. I did do this, here is a screenshot of what it looks like. This had been done already but the issue persists.
Hi!
Same here. I redirected URIs and now the message is Illegal scope. Any tips?
Thanks!!
I think by default the methods choose something like "all scopes", which Spotify's API rejects internally.
If you go to the Spotify API documentation, you should be able to search for scopes and identify the scope you want. For example, I think reading from playlists would be "read-user-private" or something along those lines. Then, once you know the scope, in the R code add an argument to the method/function you're calling called scope = "the-scope-you're-looking-for". This will override the default "all scopes".
Hopefully that helps - good luck!
Hi all! Joining this thread since I similarly ran into this issue. Sharing what I did in case it helps, using "Most recent tracks" as an example for taking @njcorona's advice re: specific scoping:
Sys.setenv(SPOTIFY_CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxx')
Sys.setenv(SPOTIFY_CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxx')
access_token <- get_spotify_authorization_code(scope = 'user-read-recently-played')
get_my_recently_played(limit = 5, authorization = access_token)
It seems like this confusion might have stemmed from docs/readme. For me, it came down to two differences:
get_spotify_authorization_code()
instead of get_spotify_access_token()
(recommended in the readme). The latter doesn't allow you to specify the scope, so I likely hit what @njcorona described. access_token
to every relevant subsequent method so the scope carries. Relying on the default value for the authorization
param (à la readme's suggestion) meant that I also hit the "Illegal scope" message that @pbrazda described.If this is the expected behavior, happy to help update the readme so future users don't experience this friction point. Let me know whether you're taking contributions @charlie86!
I too an experiencing the same issue, I can't get anything that relates to my personal info/activity - always get Illegal scope
please can you show me how would you edit this code to include the reference to access_token?
get_my_top_artists_or_tracks(type = 'tracks', time_range = 'short_term', limit = 5) %>% mutate(artist.name = map_chr(artists, function(x) x$name[1])) %>% select(name, artist.name, album.name) %>% kable()
I see this as a documentation issue at first sight.
Hello,
I have tried several times to get authorization code in RStudio with the following code:
install.packages('spotifyr') library(spotifyr) Sys.setenv(SPOTIFY_CLIENT_ID = 'my id') Sys.setenv(SPOTIFY_CLIENT_SECRET = 'my secret') spotifyr::get_spotify_authorization_code(client_id = Sys.getenv("SPOTIFY_CLIENT_ID"), client_secret = Sys.getenv("SPOTIFY_CLIENT_SECRET"), scope = spotifyr::scopes)
The only Redirect URI I have is http://localhost:1410/ as I've seen people recommend that's the URI you use. A screen pops up and states INVALID_CLIENT: Invalid redirect URI. I've tried restarting RStudio, my laptop, etc. Not sure what I'm doing wrong.