vendredi 30 mai 2014

Accessing the Omniauth Builder created in an initializer to create an access token


Vote count:

0




I'm writing a little app for Coinbase and I'm making an initializer that I've thrown in omniauth.rb



Rails.application.config.middleware.use OmniAuth::Builder do
provider :coinbase, ENV["COINBASE_CLIENT_ID"], ENV["COINBASE_CLIENT_SECRET"], scope: "sell send transfers user"
end


I want to be able to access this anywhere in my app so that I can create an access_token for the user. Based on their docs and the research I've done into Omniauth, I'm not quite sure how to do this.


Should I throw an instance variable and an = in front of the code posted above? Is that a correct solution? Also, how do I go about getting an access_token after initializing this?


Thanks!



asked 30 secs ago






Aucun commentaire:

Enregistrer un commentaire