Sha256: 3e780184da4a8eff409c69e9738b1725a70aa20c2414cc622c7f08e1e2ee8730

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

require 'omniauth-oauth2'

module OmniAuth
	module Strategies
		class Eivo < OmniAuth::Strategies::OAuth2
		
			option :name, "eivo"

			option :client_options, { :site => "https://sso.eivo.fr" }

			uid { raw_info['id'] }

			info do
				{
					:email => raw_info['email']
				}
			end

			extra do
				{
					'raw_info' => raw_info
				}
			end

			def raw_info
				@raw_info ||= access_token.get('/api/v1/me.json').parsed
			end

			# Required for omniauth-oauth2 >= 1.4
			# https://github.com/intridea/omniauth-oauth2/issues/81
			def callback_url
				full_host + script_name + callback_path
			end

		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-eivo-oauth2-1.0.0 lib/omniauth/strategies/eivo.rb