lib/openid_connect/discovery/provider/config/response.rb in openid_connect-0.9.2 vs lib/openid_connect/discovery/provider/config/response.rb in openid_connect-0.10.0

- old
+ new

@@ -8,14 +8,14 @@ cattr_accessor :metadata_attributes attr_reader :raw uri_attributes = { required: [ :issuer, + :authorization_endpoint, :jwks_uri ], optional: [ - :authorization_endpoint, :token_endpoint, :userinfo_endpoint, :registration_endpoint, :service_documentation, :op_policy_uri, @@ -70,11 +70,13 @@ hash.merge! _attr_ => value unless value.nil? hash end end - def validate! - valid? or raise ValidationFailed.new(self) + def validate!(expected_issuer = nil) + valid? && ( + expected_issuer.blank? || issuer == expected_issuer + ) or raise ValidationFailed.new(self) end def jwks @jwks ||= JSON.parse( OpenIDConnect.http_client.get_content(jwks_uri) \ No newline at end of file