Module: OpenID

Defined in:
lib/omniauth/openid/gapps.rb

Class Method Summary collapse

Class Method Details

.discover(uri) ⇒ Object

Because gapps_openid changes the discovery order (looking first for Google Apps, then anything else), we need to monkeypatch it to make it play nicely with others.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/omniauth/openid/gapps.rb', line 9

def self.discover(uri)
  discovered = self.default_discover(uri)

  if discovered.last.empty?
    info = discover_google_apps(uri)
    return info if info
  end

  return discovered
rescue OpenID::DiscoveryFailure => e
  info = discover_google_apps(uri)

  if info.nil?
    raise e
  else
    return info
  end
end

.discover_google_apps(uri) ⇒ Object



28
29
30
31
# File 'lib/omniauth/openid/gapps.rb', line 28

def self.discover_google_apps(uri)
  discovery = GoogleDiscovery.new
  discovery.perform_discovery(uri)
end