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

Ignore Associations For OpenID2 (Google's Security Bug Fix) #53

Merged
merged 2 commits into from
Sep 14, 2013
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/openid/consumer/checkid_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_message(realm, return_to=nil, immediate=false)
end
end

if @assoc
if @assoc && (message.is_openid1 || !['checkid_setup', 'checkid_immediate'].include?(mode))
message.set_arg(OPENID_NS, 'assoc_handle', @assoc.handle)
assoc_log_msg = "with assocication #{@assoc.handle}"
else
Expand Down
15 changes: 7 additions & 8 deletions test/test_checkid_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ def test_check_no_assoc_handle
assert_openid_key_absent(msg, 'assoc_handle')
end

def test_check_with_assoc_handle
msg = assert_log_matches("Generated checkid") {
@checkid_req.get_message(@realm, @return_to, immediate)
}

assert_openid_value_equal(msg, 'assoc_handle', @assoc.handle)
end

def test_add_extension_arg
@checkid_req.add_extension_arg('bag:', 'color', 'brown')
@checkid_req.add_extension_arg('bag:', 'material', 'paper')
Expand Down Expand Up @@ -206,6 +198,13 @@ def test_op_identifier_sends_identifier_select
assert_has_required_fields(msg)
assert_has_identifiers(msg, IDENTIFIER_SELECT, IDENTIFIER_SELECT)
end

def test_no_assoc_handle
msg = assert_log_matches("Generated checkid") {
@checkid_req.get_message(@realm, @return_to, immediate)
}
assert_openid_key_absent(msg, 'assoc_handle')
end
end

class TestCheckIDRequestOpenID1 < Test::Unit::TestCase
Expand Down