laravel - 我应该在 laravel 护照刷新令牌中放什么?
问题描述
试图找到刷新令牌的解决方案。
public function refresh()
{
$http = new Client();
$response = $http->post('http://localhost/my_project/public/oauth/token', [
'form_params' => [
'grant_type' => 'refresh_token',
'client_id' => 1,
'client_secret' => '*******',
'refresh_token' => '',
'scope' => '*',
],
]);
$data = json_decode((string)$response->getBody(), true);
return [
'access_token' => $data['access_token'],
'expires_in' => $data['expires_in']
];
}
但我不知道在刷新令牌中放什么。有人可以帮我吗?
解决方案
当http://localhost/my_project/public/oauth/token
首次调用授权码时,将返回一个 refresh_token。这是您需要为refresh_token
表单参数提供的内容。
推荐阅读
- r - 如何使用 R Shiny 仪表板显示实时投票结果
- java - How to decode a byte[] of List
to Dataset in spark?
- tomcat - 内存中的 Tomcat 上下文有多大?(或者这个问题甚至相关吗?)
- java - Android GoogleMaps GroundOverlay 填充
- python - 是否需要在 scikit-learn 中对训练数据进行编码的输入进行编码?
- firebase - Firebase 记录到控制台
- sql - SQL - 我正在尝试按每个持卡人隔离或分组每笔交易,我的代码如下
- java - 即使轮询间隔非常大,协调器也不知道该成员
- c# - 在返回语句之前未等待异步承诺
- docker - 无法为基于 alpine 的 docker 安装 Microsoft ODBC Driver 17