Storing Dropbox Authentication?

I’m not familiar with the Dropbox API or their libraries, but most likely you’ll need to write your own session handler to store the session data in your WP DB (or wherever you want, safely) and associate it with your user account. Essentially adusting this line: $storage = new \Dropbox\OAuth\Storage\Session($encrypter);.

EDIT:

If it’s the WordPress side of things you are trying to figure out, you’ll need to save your OAuth tokens in a usermeta field, then instead of doing the full authentication flow, first check that there isn’t a usermeta value saved and use it if there is.

Leave a Comment