ios-sdk icon indicating copy to clipboard operation
ios-sdk copied to clipboard

renewSession returns null for refreshToken

Open paleksandrs opened this issue 5 years ago • 4 comments

I have implemented Authorization Code Flow on iOS using Spotify iOS SDK v1.2.0. I have a backend service that does the refresh of the access token. To use this service I set tokenRefreshURL on SPTSessionManager. When a session has expired I call renewSession on SPTSessionManager. I get callback func sessionManager(manager: SPTSessionManager, didRenew session: SPTSession) and the new SPTSession is missing refresh token (I can see only accessToken and expirationDate). The session object on SPTSessionManager is renewed so it is missing refresh token as well. How can I keep user authenticated if I don't get new refresh token? Any suggestions would be appreciated

Also if I can use the same refresh token, how can I set it? Because it seems there is no option to set refresh token on SPTSession.

paleksandrs avatar Nov 29 '19 07:11 paleksandrs

@paleksandrs in which part of the documentation does it say how to setup your backend swap and refresh endpoints ?

abdullah-s avatar Dec 16 '19 21:12 abdullah-s

@paleksandrs in which part of the documentation does it say how to setup your backend swap and refresh endpoints ?

https://developer.spotify.com/documentation/ios/guides/advanced-auth.md

paleksandrs avatar Dec 17 '19 07:12 paleksandrs

I think there really need to be an option to set the refreshToken parameter on SPTSession. Please implement this Spotify

ethan021021 avatar Feb 28 '20 20:02 ethan021021

Did you ever figure this out? I am running into the same issue!

griffinbaker12 avatar Nov 09 '23 09:11 griffinbaker12