Skip to content

Instantly share code, notes, and snippets.

@syguer
Last active April 23, 2019 00:31
Show Gist options
  • Save syguer/3bdd192ddc56c2f43c36 to your computer and use it in GitHub Desktop.
Save syguer/3bdd192ddc56c2f43c36 to your computer and use it in GitHub Desktop.
Get access token and secret from trello
require 'oauth'
consumer = OAuth::Consumer.new(
"CONSUMER_KEY",
"CONSUMER_SECRET",
{
site: "https://trello.com",
request_token_url: "https://trello.com/1/OAuthGetRequestToken",
authorize_url: "https://trello.com/1/OAuthAuthorizeToken",
access_token_url: "https://trello.com/1/OAuthGetAccessToken"
}
)
request_token=consumer.get_request_token
p request_token.authorize_url
print "Input your pin code => "
pin = STDIN.gets
pin.strip!
access_token = request_token.get_access_token(oauth_verifier: pin)
puts "token => #{access_token.token}"
puts "secret => #{access_token.secret}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment