Module: MuckAuth::Models::MuckAuthentication

Extended by:
ActiveSupport::Concern
Defined in:
lib/muck-auth/models/authentication.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#access_tokenObject



16
17
18
# File 'lib/muck-auth/models/authentication.rb', line 16

def access_token
  access_token = OAuth::AccessToken.new(consumer, self.token, self.secret)        
end

#consumerObject



20
21
22
# File 'lib/muck-auth/models/authentication.rb', line 20

def consumer
  strategy.consumer
end

#strategyObject



24
25
26
27
# File 'lib/muck-auth/models/authentication.rb', line 24

def strategy
  strategy_class = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(self.provider)}")
  strategy_class.new(nil, Secrets.auth_credentials[provider]['key'], Secrets.auth_credentials[provider]['secret'], :scope => Secrets.auth_credentials[provider]['scope'])
end