Specifically, I want to upload a large image on behalf of a Twitter user. I can do this all with PHP (I use codebird), but the image is generated client-side. That means I'd have to upload the image to the PHP server first, then upload it to Twitter.
Is it possible to authenticate user with PHP, then return to javascript to post the image directly? I ask because I know it's bad to get/store keys/secrets in Javascript.