Module: OpenIDConnect::Discovery::Provider

Defined in:
lib/openid_connect/discovery/provider.rb,
lib/openid_connect/discovery/provider/config.rb,
lib/openid_connect/discovery/provider/config/resource.rb,
lib/openid_connect/discovery/provider/config/response.rb

Defined Under Namespace

Modules: Issuer Classes: Config

Class Method Summary collapse

Class Method Details

.discover!(identifier) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/openid_connect/discovery/provider.rb', line 12

def self.discover!(identifier)
  resource = case identifier
  when /^acct:/, /https?:\/\//
    identifier
  when /@/
    "acct:#{identifier}"
  else
    "https://#{identifier}"
  end
  response = WebFinger.discover!(
    resource,
    rel: Issuer::REL_VALUE
  )
  response.extend Issuer
  response
rescue WebFinger::Exception => e
  raise DiscoveryFailed.new(e.message)
end