Sha256: 4fadcf562e5297206dcf3496900aff14bcd949a708dd9c9277a11a0eeb3c1318
Contents?: true
Size: 997 Bytes
Versions: 2
Compression:
Stored size: 997 Bytes
Contents
require 'oauth2' module Sorcery 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, state: @state ) 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, auth_scheme: :request_body, ssl: { ca_file: Sorcery::Controller::Config.ca_file } } ::OAuth2::Client.new( @key, @secret, defaults.merge!(options) ) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sorcery-0.17.0 | lib/sorcery/protocols/oauth2.rb |
sorcery-0.16.5 | lib/sorcery/protocols/oauth2.rb |