1 回答
TA贡献1829条经验 获得超4个赞
从此链接找到答案https://auth0.com/docs/api-auth/tutorials/client-credentials
需要添加以下行:
CURLOPT_SSL_VERIFYHOST => 假,CURLOPT_SSL_VERIFYPEER => 假,
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://xxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST =>false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET",
CURLOPT_HTTPHEADER => array(
"content-type: application/x-www-form-urlencoded"
),
));
- 1 回答
- 0 关注
- 97 浏览
添加回答
举报