class Sorcery::Providers::Base

Attributes

access_token[R]
callback_url[RW]
key[RW]
original_callback_url[RW]
secret[RW]
site[RW]
state[RW]
user_info_mapping[RW]

Public Class Methods

descendants() click to toggle source

Ensure that all descendant classes are loaded before run this

# File lib/sorcery/providers/base.rb, line 33
def self.descendants
  ObjectSpace.each_object(Class).select { |klass| klass < self }
end
name() click to toggle source
Calls superclass method
# File lib/sorcery/providers/base.rb, line 28
def self.name
  super.gsub(/Sorcery::Providers::/, '').downcase
end
new() click to toggle source
# File lib/sorcery/providers/base.rb, line 13
def initialize
  @user_info_mapping = {}
end

Public Instance Methods

auth_hash(access_token, hash = {}) click to toggle source
# File lib/sorcery/providers/base.rb, line 17
def auth_hash(access_token, hash = {})
  return hash if access_token.nil?

  token_hash = hash.dup
  token_hash[:token] = access_token.token if access_token.respond_to?(:token)
  token_hash[:refresh_token] = access_token.refresh_token if access_token.respond_to?(:refresh_token)
  token_hash[:expires_at] = access_token.expires_at if access_token.respond_to?(:expires_at)
  token_hash[:expires_in] = access_token.expires_at if access_token.respond_to?(:expires_in)
  token_hash
end
has_callback?() click to toggle source
# File lib/sorcery/providers/base.rb, line 9
def has_callback?
  true
end