Skip to content

Commit 00541e3

Browse files
committed
refresh token
1 parent ae38d49 commit 00541e3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Token.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ public function byUser($user, $client, array $scopes = [])
3939
return $this->issueToken($request, $this->response);
4040
}
4141

42+
public function refreshToken($refreshToken, $client, array $scopes = [])
43+
{
44+
$request = $this->request->withParsedBody([
45+
'grant_type' => 'refresh_token',
46+
'client_id' => $client->id,
47+
'client_secret' => $client->secret,
48+
'refresh_token' => $refreshToken,
49+
'scope' => implode(' ', $scopes)
50+
]);
51+
52+
return $this->issueToken($request, $this->response);
53+
}
54+
4255
public function issueToken(ServerRequestInterface $request, ResponseInterface $response)
4356
{
4457
try {

0 commit comments

Comments
 (0)