How to fix OpenEMR error - oauth2 keypair is missing

@adunsulag , I am trying to follow these instructions.

https://github.com/openemr/openemr/blob/master/API_README.md#authorization-code-grant

The first error I received was that the system could not read the key file. So, I changed the mod to 666 on the key file. In the error log I see the below message.

  OpenEMR.DEBUG: oauth2 request received {"endpoint":"/default/authorize"} []
  OpenEMR.ERROR: OpenEMR error - oauth2 keypair is missing, so forced exit [] []

I checked the location. The key files are there. Two of them are in the folder.
What should be the course of action to fix the key pair? This is v7.0.2 (1) with addendum applied. This system has been through a few upgrades. Is there any way to fix the key set? The OS is ubuntu 22.04.
Best!

@juggernautsei what do you have in your keys table? the oauth keys function pretty much like the sixa / sixb keys.

Do you have entries for the oauth2key and oauth2passphrase keys?

My next question would be if this is docker, are the keys visible inside the docker container? I’m assuming they are, but its good to verify you’re not doing something outside the docker container.

Yes, the keys are in the keys table.