Getting an odd refresh token when authenticating via Spotify App Remote's SPTSession on iOS

140 Views Asked by At

When I authenticate with Spotify's iOS App Remote SDK (using SPTSession), the refresh token string I get back from the following didInitiate delegate method is very odd:

sessionManager(manager: SPTSessionManager, didInitiate session: SPTSession)

It contains lots of slashes (/'s and 's) and always ends with ==\n. e.g:

b8H5valXhxW9TuyV32crw7Ra+60FYCDDIv2mmJPznVuLA5hvmafbAggnEM/q
y7s4d+g3iXIzZ7s/Fcl/IXfc6CIn6G+kUXvhJpQDnHMi5NvRfgQ0i+qu/KKs
TqovRzfOOoaUo7EKHzXCwlhCbYM3YFjdFNchQwc4DShQCuvG0D/ql6RiSMHh
PA==

This does not seem like a correct refresh token, and fails to refresh when hitting my server's refresh logic. How can I fix this?

1

There are 1 best solutions below

0
Evan Kaminsky On

Well, I'll be. I was able to solve this by removing the tokenSwapURL and tokenRefreshURL properties from the SPTConfiguration object. I was setting those URLs to the ones required by the Heroku One-Click Spotify Token Swap Service. Very odd that simply setting those properties causes such mayhem!