Issue with Missing refresh_token in Spotify iOS SDK Authorization Flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Free/Premium
Country
Brasil
Device
Macbook M2 2023
Operating System
macOS Sonoma 14.6.1
I am developing an iOS application using the Spotify iOS SDK and am facing difficulties obtaining the refresh_token after the authorization request. I followed the steps described in the documentation and successfully retrieve the access_token, but the refresh_token, which theoretically should be returned along with the access_token, is missing from the response.
Here are more details about my implementation:
- I used the authorization flow that involves requesting access permission via OAuth.
- After authorization, I receive the access_token correctly, but the refresh_token is not included in the API response.
- The flow I'm using is based on the example provided in the official SDK documentation.
Could you please guide me on what might be causing this issue or provide more information on how to resolve it?
Note: I used a print statement to check what I was getting as a return from the setAccessToken method, and this was the result:
func setAccessToken(from url: URL) {
let parameters = appRemote.authorizationParameters(from: url)
//Print Parameters
if let parameters = parameters {
print("Authorization Parameters:")
for (key, value) in parameters {
print("\(key): \(value)")
}
}
if let accessToken = parameters?[SPTAppRemoteAccessTokenKey] {
appRemote.connectionParameters.accessToken = accessToken
self.accessToken = accessToken
print("Access Token: \(accessToken)")
} else if let errorDescription = parameters?[SPTAppRemoteErrorDescriptionKey] {
print("Error: \(errorDescription)")
}
}
Result I got:
{
"expires_in": 3600,
"token_type": "Bearer",
"spotify_version": "8.9.68.490",
"access_token": "BQAPe....vA9cdtAI-wE"
}
Result I was expecting:
{
"expires_in": 3600,
"token_type": "Bearer",
"spotify_version": "8.9.68.490",
"access_token": "BQAPe...vA9cdtAI-wE",
"refresh_token": "AQC2skl...P9GfhTnki9"
}
Thank you in advance for your help!
- Labels:
-
Question
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page