Accessing Standard API with Client Credentials Grant Authorization Flow

I’ve successfully implemented Client Credentials Grant authorization flow and it works properly for accessing the FHIR API. But when I make request to Standard Api (api/patient endpoint), I get following error in the log:
OpenEMR Error: api failed because user role does not have access to the resource {"resource":"/api/patient","userRole":"system"}

When I use any other authorization flow, I don’t encounter this issue, and everything works as expected. All scopes from documentation are included.
OpenEmr version - 7.0.2

Is is possible to access Standard API with Client Credentials Grant Authorization Flow?

Hi @Roman_Zakaliak
I understand that you have encountered issue with accessing standard API with client credentials,you can try out these steps and check,

You should provide the following scope during API client Registration and provide role as user.

Scope : openid api:oemr api:fhir api:port user/allergy.read user/allergy.write user/appointment.read user/appointment.write user/dental_issue.read user/dental_issue.write user/document.read user/document.write user/drug.read user/encounter.read user/encounter.write user/facility.read user/facility.write user/immunization.read user/insurance.read user/insurance.write user/insurance_company.read user/insurance_company.write user/insurance_type.read user/list.read user/medical_problem.read user/medical_problem.write user/medication.read user/medication.write user/message.write user/patient.read user/patient.write user/practitioner.read user/practitioner.write user/prescription.read user/procedure.read user/soap_note.read user/soap_note.write user/surgery.read user/surgery.write user/vital.read user/vital.write user/AllergyIntolerance.read user/CareTeam.read user/Condition.read user/Encounter.read user/Immunization.read user/Location.read user/Medication.read user/MedicationRequest.read user/Observation.read user/Organization.read user/Organization.write user/Patient.read user/Patient.write user/Practitioner.read user/Practitioner.write user/PractitionerRole.read user/Procedure.read patient/encounter.read patient/patient.read patient/Encounter.read patient/Patient.read

If you have any questions or need further assistance, please feel free to contact us at openemr.support@visolve.com .
-ViSolve AI Team