Getting OmniAuth provider settings
I have OmniAuth setup to use Twitter like so:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
end
How do 开发者_StackOverflow社区I retrieve the OmniAuth settings for the Twitter key and secret somewhere else my my app, like in a model?
Instead of inserting the key and secret in the middleware declaration as a string, you could setup a constant in an initializer and refer to the key/secret using the constant in both the middleware and elsewhere in your app.
精彩评论