Open omadepod opened 4 years ago
You'll need to just generate a new token again.
When i get redirected to my callback.php i get this authorization code
Array ( [code] => AQBeH28UwSp... )
I call this function
$session->requestAccessToken($_GET['code']);
/
@return bool True when the access token was successfully granted, false otherwise. */ public function requestAccessToken($authorizationCode) { $parameters = [ 'client_id' => $this->getClientId(), 'client_secret' => $this->getClientSecret(), 'code' => $authorizationCode, 'grant_type' => 'authorization_code', 'redirect_uri' => $this->getRedirectUri(), ];
$response = $this->request->account('POST', '/api/token', $parameters, []);
$response = $response['body'];
if (isset($response->refresh_token) && isset($response->access_token)) {
$this->refreshToken = $response->refresh_token;
$this->accessToken = $response->access_token;
$this->expirationTime = time() + $response->expires_in;
$this->scope = $response->scope ?? $this->scope;
return true;
}
return false;
}
Fatal error: Uncaught SpotifyWebAPIAuthException: Invalid authorization code in C:\xampp\htdocs\system\spotify\src\Request.php:54 Stack trace: #0 C:\xampp\htdocs\system\spotify\src\Request.php(254): ... #3 C:\xampp\htdocs\system\spotify\callback.php(61): Session->requestAccessToken('AQBeH28UwSpTV2y...')
Hi all,
I didn't write down my accesstoken and didn't have the refreshtoken code in my project. So now i keep getting "Authorization code expired". I tried to make a new project but i keep getting the same error.
Thanks