Last active
April 23, 2019 00:31
-
-
Save syguer/3bdd192ddc56c2f43c36 to your computer and use it in GitHub Desktop.
Get access token and secret from trello
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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