Sha256: 83015729ad1510716a213947574f89e6f610d1c0371e91d894ab629141cd336d
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
require 'omniauth/strategies/oauth2' require 'omniauth/infinum/configuration' module OmniAuth module Strategies class Infinum < OmniAuth::Strategies::OAuth2 ############# ### Setup ### ############# option :client_options, { site: "https://accounts.infinum.co", authorize_url: "/auth/infinum/authorize", access_token_url: "/auth/infinum/access_token" } uid { raw_info['id'] } info do { email: raw_info['email'] } end # info extra do { first_name: raw_info['extra']['first_name'], last_name: raw_info['extra']['last_name'], email: raw_info['extra']['email'], avatar_url: raw_info['extra']['avatar_url'], slack_username: raw_info['extra']['slack_username'] } end # extra ############## ### Phases ### ############## def request_phase super end # request_phase def callback_phase super end # callback_phase ############### ### Helpers ### ############### def raw_info @raw_info ||= access_token.get("/auth/infinum/user.json?oauth_token=#{access_token.token}").parsed end # raw_info end # Facebook end # Strategies end # OmniAuth
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
omniauth-infinum-0.11.1 | lib/omniauth/strategies/infinum.rb |