Sha256: c994bb64842b8fe47149f91705702f618288e0710167b0ab6ffddb7953528e0b

Contents?: true

Size: 788 Bytes

Versions: 3

Compression:

Stored size: 788 Bytes

Contents

require 'omniauth-oauth2'

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

      option :client_options, {
	site: AUTH_URL,
	authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
	token_url: "#{AUTH_URL}/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

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-matique-0.1.5 lib/omniauth/strategies/matique.rb
omniauth-matique-0.1.3 lib/omniauth/strategies/matique.rb
omniauth-matique-0.1.2 lib/omniauth/strategies/matique.rb