Hello, I am facing some 401 errors when accessing JIRA REST API from a custom PHP Laravel APP.
root@32cde58b717d:/var/www/app# php artisan company:import-jira-tasks
2023-04-28 07:46:58 Importing from Jira…
[2023-04-28 19:46:58] production.ERROR: Guzzle\Http\Exception\ClientErrorResponseException [0] : /var/www/app/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php [Line 43] => Client error response [status code] 401 [reason phrase] Unauthorized [url] mydomain.atlassian.net/rest/api/3/search?fields=parent%2Cproject%2Csummary%2Cdescription%2Ccustomfield_10022%2Ccustomfield_10802%2Ccustomfield_10800%2Cresolutiondate%2Ccreated%2Cchangelog%2Ccustomfield_10809%2Ccustomfield_10017%2Cstatus%2Cassignee%2Cissuetype%2Cattachment%2Creporter&expand=changelog&startAt=0&maxResults=100
[Guzzle\Http\Exception\ClientErrorResponseException]
Client error response
[status code] 401
[reason phrase] Unauthorized
root@32cde58b717d:/var/www/app#
After reading this documentation [developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication] I was able to access it from my machine using:
java -jar OAuthTutorialClient-1.0.jar request [url]
THen I reproduced all steps on my VPS (environment variables) to use new tokens and CERT but now I am getting this error:
[ErrorException]
openssl_sign(): supplied key param cannot be coerced into a private key
Can anyone help me?
Thanks.
Ricardo