Sha256: 1be3443a16a9fa465698d2da5c24a8d25b4e5d6a50bbccab458a279ba3ded47c
Contents?: true
Size: 1.15 KB
Versions: 9
Compression:
Stored size: 1.15 KB
Contents
require 'oauth2' module Sorcery module Controller module Submodules module External module Protocols module Oauth2 def oauth_version "2.0" end def authorize_url(options = {}) client = build_client(options) client.auth_code.authorize_url( :redirect_uri => @callback_url, :scope => @scope, :display => @display ) end def get_access_token(args, options = {}) client = build_client(options) client.auth_code.get_token( args[:code], { :redirect_uri => @callback_url, :parse => options.delete(:parse) }, options ) end def build_client(options = {}) defaults = { :site => @site, :ssl => { :ca_file => Config.ca_file } } ::OAuth2::Client.new( @key, @secret, defaults.merge!(options) ) end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems