Sha256: 450fcd3ebb8d4d4e7b29ea2c9c52391ed68139b904e58cc32b7820c6aa2ee799

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Matique < OmniAuth::Strategies::OAuth2
# AuthUrl = ENV["HEROKU_AUTH_URL"] || "https://id.heroku.com"
#      SITE = 'https://login.matique.de'
      SITE = 'http://localhost:3010'
      STRATEGY = 'matique'

      option :client_options, {
	site: SITE,
	authorize_url: "#{SITE}/auth/#{STRATEGY}/authorize",
	token_url: "#{SITE}/auth/#{STRATEGY}/access_token"
      }

      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(
	 "/auth/matique/user.json?oauth_token=#{access_token.token}").
	 parsed || {}
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-matique-0.1.1 lib/omniauth/strategies/matique.rb