[GH-ISSUE #76] RefreshToken is empty #41

Closed
opened 2026-02-27 19:25:45 +03:00 by kerem · 2 comments
Owner

Originally created by @gabrielalack on GitHub (Apr 4, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/76

I followed the most basic login steps, no user required

$session = new Session('code', 'pass');
$scopes = array(
			'playlist-read-private',
			'user-read-private'
			);
$session->requestCredentialsToken($scopes);

$this->token = $session->getAccessToken();
$this->refreshToken = $session->getRefreshToken();

die(var_dump($this->refreshToken)); <---- empty

I'm able to get an auth token and it works fine, but the refresh token is empty. Am I doing something wrong?

Originally created by @gabrielalack on GitHub (Apr 4, 2017). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/76 I followed the most basic login steps, no user required ``` $session = new Session('code', 'pass'); $scopes = array( 'playlist-read-private', 'user-read-private' ); $session->requestCredentialsToken($scopes); $this->token = $session->getAccessToken(); $this->refreshToken = $session->getRefreshToken(); die(var_dump($this->refreshToken)); <---- empty ``` I'm able to get an auth token and it works fine, but the refresh token is empty. Am I doing something wrong?
kerem 2026-02-27 19:25:45 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (Apr 4, 2017):

Hi!
You're not doing anything wrong, the Client Credentials Flow doesn't provide you with refresh tokens, I don't why exactly but I think it's because you're only authenticating the app and not a user.

Hope this helps!

<!-- gh-comment-id:291598167 --> @jwilsson commented on GitHub (Apr 4, 2017): Hi! You're not doing anything wrong, the [Client Credentials Flow](https://developer.spotify.com/web-api/authorization-guide/#client-credentials-flow) doesn't provide you with refresh tokens, I don't why exactly but I think it's because you're only authenticating the app and not a user. Hope this helps!
Author
Owner

@jwilsson commented on GitHub (May 6, 2017):

Closing this due to inactivity. Please leave a comment if you need anything else!

<!-- gh-comment-id:299620325 --> @jwilsson commented on GitHub (May 6, 2017): Closing this due to inactivity. Please leave a comment if you need anything else!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#41
No description provided.