How to delete active OAuth2 tokens?


I’ve created an OAuth2 client with client_credentials grant type in SuiteCrm v8.3. It all works fine and I am able to use the API as intended. However, while making API calls using Postman I’ve noticed that the list of OAuth2 tokens in SuiteCrm keeps growing and never go away. I can only revoke the tokens and I can’t seem to delete them. I plan to use the API daily so I’m concerned there will be thousands of tokens eventually. Do I need to delete these old tokens? Will it cause an issue in the future? All tokens have expired.


You can write a cron job to check and delete the expired token by date field in Mysql query. If you know SuiteCRM Scheduler module, you can do it very well.
And the manual thing is to delete them from User interface but i do recommend they should be deleted from CRON job may be once in a week.


Thanks for the reply.

Is it safe to delete from the table directly?

I looked around in the Auth Tokens view in SuiteCRM and I didn’t see a way to delete them using the user interface. So, I believe you’re saying the method to use is a delete query using CRON job or scheduler, correct?

yes I was talking about query.