Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Issue #125 - Addressing missing server url in check_signature method #128

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/openid/consumer/idres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,21 @@ def verify_return_to_base(msg_return_to)

# Raises ProtocolError if the signature is bad
def check_signature
# ----------------------------------------------------------------------
# The server url must be defined within the endpoint instance for the
# OpenID2 namespace in order for the signature check to complete
# successfully.
#
# This fix corrects issue #125 - Unable to complete OpenID login
# with ruby-openid 2.9.0/2.9.1
Comment on lines +211 to +212
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can ✂️ this out from here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fine to remove those two comment lines during the merge.

# ---------------------------------------------------------------------
set_endpoint_flag = false
if @endpoint.nil? && openid_namespace == OPENID2_NS
@endpoint = OpenIDServiceEndpoint.new
@endpoint.server_url = fetch('op_endpoint')
set_endpoint_flag = true
end

if @store.nil?
assoc = nil
else
Expand All @@ -223,6 +238,7 @@ def check_signature
raise ProtocolError, "Bad signature in response from #{server_url}"
end
end
@endpoint = nil if set_endpoint_flag # Clear endpoint if we defined it.
end

def check_auth
Expand Down