mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Updating GApps and OpenID strategies a bit.
This commit is contained in:
parent
7300af48a4
commit
549b0c71e2
2 changed files with 7 additions and 6 deletions
|
@ -3,14 +3,13 @@ require 'omniauth/openid'
|
||||||
module OmniAuth
|
module OmniAuth
|
||||||
module Strategies
|
module Strategies
|
||||||
class GoogleApps < OmniAuth::Strategies::OpenID
|
class GoogleApps < OmniAuth::Strategies::OpenID
|
||||||
def initialize(app, domain, store = nil, options = {})
|
def initialize(app, store = nil, options = {})
|
||||||
@domain = domain
|
options[:name] ||= 'google_apps'
|
||||||
options[:name] ||= 'apps'
|
|
||||||
super(app, store, options)
|
super(app, store, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def identifier
|
def identifier
|
||||||
@domain
|
options[:domain] || request['domain']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,8 @@ module OmniAuth
|
||||||
class OpenID
|
class OpenID
|
||||||
include OmniAuth::Strategy
|
include OmniAuth::Strategy
|
||||||
|
|
||||||
|
attr_accessor :options
|
||||||
|
|
||||||
# Should be 'openid_url'
|
# Should be 'openid_url'
|
||||||
# @see http://github.com/intridea/omniauth/issues/issue/13
|
# @see http://github.com/intridea/omniauth/issues/issue/13
|
||||||
IDENTIFIER_URL_PARAMETER = 'identifier'
|
IDENTIFIER_URL_PARAMETER = 'identifier'
|
||||||
|
@ -26,8 +28,8 @@ module OmniAuth
|
||||||
def initialize(app, store = nil, options = {})
|
def initialize(app, store = nil, options = {})
|
||||||
super(app, options[:name] || :open_id)
|
super(app, options[:name] || :open_id)
|
||||||
@options = options
|
@options = options
|
||||||
@options[:required] ||= [AX[:email], AX[:name], 'email', 'fullname']
|
@options[:required] ||= [AX[:email], AX[:first_name], AZ[:last_name], 'email', 'fullname']
|
||||||
@options[:optional] ||= [AX[:first_name], AX[:last_name], AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']
|
@options[:optional] ||= [AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']
|
||||||
@store = store
|
@store = store
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue