Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle apps script oauth connect doesn't work with trello
    text
    copied!<p>I've been trying to use oAuth in <a href="https://docs.google.com/macros/" rel="noreferrer">Google apps script</a> to access trello data, but it seems that the OAuthService API makes some assumptions about the oAuth service and that trello doesn't work that way.</p> <p>The following code works. It get's access to twitter (this is from google's oauth tutorial):</p> <pre><code>function authorizeToTwitter() { var oauthConfig = UrlFetchApp.addOAuthService("twitter"); oauthConfig.setAccessTokenUrl("https://api.twitter.com/oauth/access_token"); oauthConfig.setRequestTokenUrl("https://api.twitter.com/oauth/request_token"); oauthConfig.setAuthorizationUrl("https://api.twitter.com/oauth/authorize"); oauthConfig.setConsumerKey(&lt;CONSUMER KEY&gt;); oauthConfig.setConsumerSecret(&lt;CONSUMER SECRET&gt;); var requestData = { "method": "GET", "oAuthServiceName": "twitter", "oAuthUseToken": "always" }; var result = UrlFetchApp.fetch("https://api.twitter.com/1/statuses/mentions.json", requestData); } </code></pre> <p>The following code will get me to the trello "press ok to get back" page, but trello doesn't know how to redirect back, so I get to a page that asks me to manually copy paste a token (but google doesn't provide me with a method of inserting that token)</p> <pre><code>function authorizeToTrello() { var oauthConfig = UrlFetchApp.addOAuthService("trello"); oauthConfig.setAccessTokenUrl("https://trello.com/1/OAuthGetAccessToken"); oauthConfig.setRequestTokenUrl("https://trello.com/1/OAuthGetRequestToken"); oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken"); oauthConfig.setConsumerKey(&lt;CONSUMER KEY&gt;); oauthConfig.setConsumerSecret(&lt;CONSUMER SECRET&gt;); var requestData = { "method": "GET", "oAuthServiceName": "trello", "oAuthUseToken": "always" }; var result = UrlFetchApp.fetch( "https://api.trello.com/1/members/me/boards", requestData); } </code></pre> <p>I tried to fix that by manually adding the redirect callback that I provide to twitter in the the authorization url </p> <pre><code>oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken?return_url=https://docs.google.com/macros"); //this is what the tutorial says I should provide to twitter </code></pre> <p>or </p> <pre><code>oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken?return_url=https://docs.google.com/macros/externaloauthcallback"); //this is what twitter actually calls when performing the oauth dance </code></pre> <p>But both don't work. Am I doing something wrong? Am I missing some configuration parameters that I should be providing?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload