简体   繁体   中英

Google Apps Script to Get Users' Tweets on Their Behalves

I was trying out Google Apps Script and Twitter API. It works perfectly for my Twitter account but what I want is users to make my script work on their behalves logging in with their Twitter account.

I was hoping this process is automated by turning on "Allow this application to be used to Sign in with Twitter" in Settings page of my Twitter application (asking twitter user authorization to execute app each time). It is not. GAS script executes as if my user is already authanticated by twitter.

I understand how it is done in general from Twitter developer documentations (3-legged authorization), but I can't figure out how it is done with given GAS OAuthConfig class and URL Fetch Service. I've played with oAuthUseToken , assigning different values such never or if_available , it didn't work either.

Any help would be appreciated.

So far what I have found, but didn't try out yet (I was searching for completely different subject, yet somehow related to this):

Eric Coleda wrote in this Google Apps Script Issues post that we can now make our own OAuth2 flow by using state tokens and the usercallback endpoint which were added to ScriptApp Class .

They don't have a finished example at the time of this post, neither do I.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM