Problem with Token Endpoint API

I am using below API to get access token but getting below error:


Notice: Key file "file://C:/Hemex LIS/xampp/htdocs/OpenEMR/sites/default/documents/certificates/oaprivate.key" permissions are not correct, recommend changing to 600 or 660 instead of 666 in C:\Hemex LIS\xampp\htdocs\OpenEMR\vendor\league\oauth2-server\src\CryptKey.php on line 74
{ "error": "invalid_request", "error_description": "Bad request", "message": "Bad request" }

curl -X POST -k -H ‘Content-Type: application/x-www-form-urlencoded’
http://localhost:80/openemr/oauth2/default/token
–data ‘grant_type=authorization_code&client_id=yi4mnmVadpnqnJiOigkcGshuG-KmLqCJsYrk4&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcallback&code=d50…’

Please provide me solution

Hi Milan,
You can change code in line number 74 below like this

if (\in_array($keyPathPerms, [‘400’, ‘440’, ‘600’, ‘640’, ‘660’,‘666’], true) === false) {

Thanks,
Param,
help@capminds.com

Thanks for the reply

1 Like