Sha256: b599f2a3ad28406126fa9f4e50252c11e1bb117f002b406a4af09eb455f1408b
Contents?: true
Size: 943 Bytes
Versions: 11
Compression:
Stored size: 943 Bytes
Contents
require 'omniauth-oauth2' module OmniAuth module Strategies class Sso < OmniAuth::Strategies::OAuth2 def raw_info @raw_info ||= access_token.get("#{_provider[:user_url]}.json?oauth_token=#{access_token.token}").parsed end def self._provider; SsoClyent.provyder;end def _provider; SsoClyent.provyder;end option :client_options, { :site => _provider[:url], :authorize_url => _provider[:authorize_url], :token_url => _provider[:access_token_url] } option :provider_ignores_state, true uid { raw_info[_provider[:user][:uid]] } info do _provider[:user][:info].inject({}) do |h,inf| h.merge({inf.to_sym => raw_info.send(:[], inf)}) end end extra do _provider[:user][:extras].inject({}) do |h,inf| h.merge({inf.to_sym => raw_info['extra'].try(:[], inf)}) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems