Sha256: 0fd04b3c483ab510fdfffe3a1634738bdc8cfbe6121ff3b717ad5fcf14e10ba1

Contents?: true

Size: 928 Bytes

Versions: 2

Compression:

Stored size: 928 Bytes

Contents

require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class EveOnlineSso < OmniAuth::Strategies::OAuth2
      option :name, 'eve_online_sso'

      option :client_options, authorize_path: '/oauth/authorize',
                              site: 'https://login.eveonline.com/',
                              proxy: ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil

      uid { raw_info['CharacterID'] }

      info do
        {
          name: raw_info['CharacterName'],
          character_id: raw_info['CharacterID'],
          expires_on: raw_info['ExpiresOn'],
          scopes: raw_info['Scopes'],
          token_type: raw_info['TokenType'],
          character_owner_hash: raw_info['CharacterOwnerHash']
        }
      end

      extra do
        {
          raw_info: raw_info
        }
      end

      def raw_info
        @raw_info ||= access_token.get('/oauth/verify').parsed
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omniauth-eve_online-sso-0.2.0 lib/omniauth/strategies/eve_online_sso.rb
omniauth-eve_online-sso-0.1.0 lib/omniauth/strategies/eve_online_sso.rb