Api Signature verification failed

Hello,
I have problem with ApiToken. When i generate him i get token where payload is null. When i trying use this i get error “Signature verification failed”. Please help. example “(removed)”

Hi @praca_praca,

Have you set an api_key_secret in your config.inc.php configuration file? Make sure one is entered there, and that it’s long enough. (I forget the minimum length but OTOH something that is at least 512 bits, or 64 bytes, should be secure.)

Regards,
Alec Smecher
Public Knowledge Project Team

I found in the code that the method $user->getSetting(‘apiKey’) returns null. Is something missing in the database?

Hi @praca_praca,

Before I dig into this further, what version of OJS are you using? Have you checked the api_key_secret and re-generated a key, as suggested above?

Regards,
Alec Smecher
Public Knowledge Project Team

I’m using the version 3.2.0.2 and i added long api_key_secret. When I added the apiKey and apiKeyEnabled entries to the database manually, it started working properly.