我正在运行Fedora 16 32bit并且我使用nginx安装了乘客(在安装期间选项1,一切都是为我处理的).安装没问题,但是nginx没有注册为服务.
我可以直接通过它的唯一方法/opt/nginx/sbin/nginx.没有可能通过它运行它/etc/init.d/nginx
有什么方法可以将其注册为服务吗?
在access_token由社会名流收购(通过Socialite::driver(self::PROVIDER)->user()具有有限的时间有效性。对于谷歌这是一个小时。
我可以refresh_token通过将重定向调用更改为:
Socialite::driver(self::PROVIDER)->stateless()->with([
'access_type' => 'offline',
])->redirect()
Run Code Online (Sandbox Code Playgroud)
一个小时内,我可以access_token通过调用读取用户数据
// $token = read_stored_access_token()
\Socialite::driver(self::PROVIDER)->userFromToken($accessToken);
Run Code Online (Sandbox Code Playgroud)
一小时后,当令牌失效时,Google API 开始返回401 Unauthorized,Socialize 将其传播出去:
(1/1) ClientException
Client error: `GET https://www.googleapis.com/plus/v1/people/me?prettyPrint=false` resulted in a `401 Unauthorized` response:
{"error":{"errors":[{"domain":"global","reason":"authError","message":"Invalid Credentials","locationType":"header","loc (truncated...)
Run Code Online (Sandbox Code Playgroud)
现在有了refresh_token,我应该可以轻松刷新了access_token。但是我在 Socialize 文档或源代码中找不到允许我这样做的提及。
真的是唯一的方法来完成这个使用谷歌的 API 库并手动执行此操作吗?它不会扼杀使用 Socialize 的整个想法吗?
注意:我试图避免redirect()再次拨打电话,因为这可能会迫使用户每小时选择一个他的 Google 帐户,这很烦人。
谢谢!