Saving OAuth keys between sessions?

Hi, I am building a Connector that needs to authenticate using OAuth. The problem I have is that I have not been able to figure out a way to store the OAuth keys between sessions that would work on the Cloud Agent. At the moment I use an On-Premise agent and are saving the keys in a text file on disk, but that's not a very good solution.

Any help are welcome :-)