Posts

Simple PHP code for AWS Cognito OAuth2 authentication and extract client data from user pool

         require '<your-path>/vendor/autoload.php' ;           use Aws\CognitoIdentityProvider\ CognitoIdentityProviderClient ;           use Aws\Exception\ AwsException ;           use GuzzleHttp\ Client ;           use GuzzleHttp\ HandlerStack ;           use GuzzleHttp\ Middleware ;           use GuzzleHttp\Psr7\ Uri ;           use Firebase\JWT\ JWT ;           use Firebase\JWT\ Key ; $clientId     = '<YOUR-CLIENT-ID>' ;           $accessKey    = '<YOUR-AWS-ACCESS-KEY>' ;           $clientSecret = ' <YOUR-AWS-CLIENT-SECRET> ' ;           $userPoolId   = ' <YOUR-...

WAMP64: AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate

Image
  Often, cURL error 60: SSL certificate problem: unable to get local issuer certificate error occurs when we try to call the API with the secure  https://  protocol in the request URL. This error occurs because the API call makes a secure connection request using the self-signed certificate. When it does not find a valid certificate, it throws an error. It has a very very simple solution. We just need to download the certificate and set the path.  1. Download the  “cacert.pem”  free certificate file from the official website here:  http://curl.haxx.se/docs/caextract.html 2. Move the  cacert.pem  file in a reachable destination for the PHP. It is advisable to move the file for the WAMP user to  C:\wamp64\bin\php\cacert.pem , for XAMPP user to C:\xampp\php\extras\ssl\cacert.pem, for the AMPPS user to  C:\Program Files (x86)\Ampps\php\extras\ssl\cacert.pem 3.  Now, open your  php.ini   file and find the   “curl.cain...