Sha256: 42c95147e74a62fe6a9286d899efd169a6b1bd1f004767b18084b4d8b95fa417

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 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']
					:first_name => raw_info['firstname']
					:last_name => raw_info['lastname']
				}
			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.1 lib/omniauth/strategies/eivo.rb