Ale*_*ian 5 php ssl curl mamp localhost
我使用 MAMP 作为本地开发环境。我想实施 Google 身份验证 - 但不断收到此 SSL 错误。
curl.cainfo ="C:/MAMP/bin/php/php7.4.1/extras/ssl/cacert.pem"
Run Code Online (Sandbox Code Playgroud)
知道如何在我的本地环境中传递此 SSL 错误吗?
这是代码:
$google_client = new \Google_Client();
$google_client->setClientId($clientID);
$google_client->setClientSecret($clientSecret);
$google_client->setRedirectUri($redirectUri);
$google_client->addScope("email");
$google_client->addScope("profile");
if($this->request->getVar('code')){
$token = $google_client->fetchAccessTokenWithAuthCode($this->request->getVar('code'));
if(!isset($token['error'])){
$google_client->setAccessToken($token['access_token']);
$this->session->set('access_token', $token['access_token']);
//get Google profile data
$google_service = new \Google_Service_Oatuth2($google_client);
$data = $google_service->userinfo->get();
print_r($data);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5581 次 |
| 最近记录: |