Class: OpenIDConnect::Discovery::Provider::Config

Inherits:
Object
  • Object
show all
Defined in:
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

Classes: Resource, Response

Class Method Summary collapse

Class Method Details

.discover!(identifier, cache_options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/openid_connect/discovery/provider/config.rb', line 5

def self.discover!(identifier, cache_options = {})
  uri = URI.parse(identifier)
  Resource.new(uri).discover!(cache_options).tap do |response|
    response.expected_issuer = identifier
    response.validate!
  end
rescue SWD::Exception, ValidationFailed => e
  raise DiscoveryFailed.new(e.message)
end