php-connect-rest-sample icon indicating copy to clipboard operation
php-connect-rest-sample copied to clipboard

issue in outh.php

Open cliffon opened this issue 9 years ago • 3 comments

after passing on my credentials and signing in ,i'm getting error in outh.php

Notice: Use of undefined constant clientId - assumed 'clientId' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 34

Notice: Use of undefined constant clientSecret - assumed 'clientSecret' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 35

Notice: Use of undefined constant redirectUri - assumed 'redirectUri' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 36

Notice: Use of undefined constant urlAuthorize - assumed 'urlAuthorize' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 37

Notice: Use of undefined constant urlAccessToken - assumed 'urlAccessToken' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 38

Notice: Use of undefined constant urlResourceOwnerDetails - assumed 'urlResourceOwnerDetails' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 39

Notice: Use of undefined constant scopes - assumed 'scopes' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 40

Notice: Use of undefined constant code - assumed 'code' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\app\oauth.php on line 65

Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlF in C:\xampp\htdocs\project\microsoft\phpconnect\php-connect-rest-sample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

could you please help

cliffon avatar Jan 09 '17 09:01 cliffon

Hi @cliffon . Thanks for reporting this issue. Did you try this troubleshooting step from the readme? If not, can you please try it?

Error: Unable to get local issuer certificate

You receive the following error after providing your credentials to the sign in page. SSL certificate problem: unable to get local issuer certificate

cURL can't verify the validity of the Microsoft certificate when trying to issue a request call to get tokens. You must configure cURL to use a certificate when issuing https requests by following these steps:

  1. Download the cacert.pem file from cURL website.
  2. Open your php.ini file and add the following line
    curl.cainfo = "path_to_cacert/cacert.pem"
    

DianeD avatar Jan 10 '17 19:01 DianeD

I offered a pull request to fix the "Use of undefined constant" notices and it was merged in yesterday, so that should be fixed.

schinkel-zz avatar Jan 19 '17 09:01 schinkel-zz

Thanks again for reporting this issue, @cliffon ! Please reopen if you're still running into this. Thanks again @schinkel for fixing!

DianeD avatar Feb 07 '17 21:02 DianeD