|
| 1 | +Feature: |
| 2 | + In order to make sure access rules are enforced for the Service Provider that started a login |
| 3 | + As an EngineBlock |
| 4 | + I want a pending login to stay bound to that Service Provider, even if another one reuses its AuthnRequest ID |
| 5 | + |
| 6 | + Background: |
| 7 | + Given an EngineBlock instance on "dev.openconext.local" |
| 8 | + And no registered SPs |
| 9 | + And no registered Idps |
| 10 | + And an Identity Provider named "Reuse-IdP" |
| 11 | + And an Identity Provider named "Other-IdP" |
| 12 | + And a Service Provider named "Easy-SP" |
| 13 | + And a Service Provider named "Target-SP" |
| 14 | + And a Service Provider named "Proxy-SP" |
| 15 | + And SP "Easy-SP" is not connected to IdP "Other-IdP" |
| 16 | + |
| 17 | + Scenario: Control - a policy enforcement deny on Target-SP denies access |
| 18 | + Given SP "Target-SP" requires a policy enforcement decision |
| 19 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 20 | + And pdp gives a deny response |
| 21 | + When I log in at "Target-SP" |
| 22 | + And I select "Reuse-IdP" on the WAYF |
| 23 | + And I pass through EngineBlock |
| 24 | + And I pass through the IdP |
| 25 | + Then I should see "Error - Access denied" |
| 26 | + |
| 27 | + Scenario: A policy enforcement deny on Target-SP is not bypassed by reusing the AuthnRequest ID |
| 28 | + Given SP "Target-SP" requires a policy enforcement decision |
| 29 | + And pdp gives a deny response |
| 30 | + And SP "Easy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 31 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 32 | + When I log in at "Easy-SP" |
| 33 | + And I pass through EngineBlock |
| 34 | + And I pass through the IdP |
| 35 | + Then the response should contain "Easy-SP will receive" |
| 36 | + When I log in at "Target-SP" |
| 37 | + Then I should see "Error - An error occurred" |
| 38 | + When I post consent for request ID "_authnrequestidreuse00000000000000000001" |
| 39 | + Then the response should not contain "/functional-testing/Target-SP/acs" |
| 40 | + And the response should contain "/functional-testing/Easy-SP/acs" |
| 41 | + |
| 42 | + Scenario: Control - an IdP that is not connected to Target-SP is not offered |
| 43 | + Given SP "Target-SP" is not connected to IdP "Reuse-IdP" |
| 44 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 45 | + When I log in at "Target-SP" |
| 46 | + Then the response should contain "/functional-testing/Other-IdP/sso" |
| 47 | + And the response should not contain "/functional-testing/Reuse-IdP/sso" |
| 48 | + |
| 49 | + Scenario: An IdP that is not connected to Target-SP cannot be used by reusing the AuthnRequest ID |
| 50 | + Given SP "Target-SP" is not connected to IdP "Reuse-IdP" |
| 51 | + And SP "Easy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 52 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 53 | + When I log in at "Easy-SP" |
| 54 | + And I pass through EngineBlock |
| 55 | + And I pass through the IdP |
| 56 | + Then the response should contain "Easy-SP will receive" |
| 57 | + When I log in at "Target-SP" |
| 58 | + Then I should see "Error - An error occurred" |
| 59 | + When I post consent for request ID "_authnrequestidreuse00000000000000000001" |
| 60 | + Then the response should not contain "/functional-testing/Target-SP/acs" |
| 61 | + And the response should contain "/functional-testing/Easy-SP/acs" |
| 62 | + |
| 63 | + Scenario: Control - a Stepup LoA required by Target-SP sends the user to Stepup |
| 64 | + Given the SP "Target-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa3" |
| 65 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 66 | + When I log in at "Target-SP" |
| 67 | + And I select "Reuse-IdP" on the WAYF |
| 68 | + And I pass through EngineBlock |
| 69 | + And I pass through the IdP |
| 70 | + Then the response should contain "/authentication/stepup/consume-assertion" |
| 71 | + |
| 72 | + Scenario: A Stepup LoA required by Target-SP is not bypassed by reusing the AuthnRequest ID |
| 73 | + Given the SP "Target-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa3" |
| 74 | + And SP "Easy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 75 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 76 | + When I log in at "Easy-SP" |
| 77 | + And I pass through EngineBlock |
| 78 | + And I pass through the IdP |
| 79 | + Then the response should contain "Easy-SP will receive" |
| 80 | + When I log in at "Target-SP" |
| 81 | + Then I should see "Error - An error occurred" |
| 82 | + When I post consent for request ID "_authnrequestidreuse00000000000000000001" |
| 83 | + Then the response should not contain "/functional-testing/Target-SP/acs" |
| 84 | + And the response should contain "/functional-testing/Easy-SP/acs" |
| 85 | + |
| 86 | + Scenario: Reusing the ID of a signed AuthnRequest of Target-SP is rejected as well |
| 87 | + Given SP "Target-SP" requires a policy enforcement decision |
| 88 | + And pdp gives a deny response |
| 89 | + And SP "Target-SP" signs its requests |
| 90 | + And SP "Easy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 91 | + And SP "Target-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 92 | + When I log in at "Easy-SP" |
| 93 | + And I pass through EngineBlock |
| 94 | + And I pass through the IdP |
| 95 | + Then the response should contain "Easy-SP will receive" |
| 96 | + When I log in at "Target-SP" |
| 97 | + Then I should see "Error - An error occurred" |
| 98 | + When I post consent for request ID "_authnrequestidreuse00000000000000000001" |
| 99 | + Then the response should not contain "/functional-testing/Target-SP/acs" |
| 100 | + And the response should contain "/functional-testing/Easy-SP/acs" |
| 101 | + |
| 102 | + Scenario: The same SP can resubmit an AuthnRequest with the same ID |
| 103 | + Given SP "Easy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 104 | + When I log in at "Easy-SP" |
| 105 | + And I log in at "Easy-SP" |
| 106 | + And I pass through EngineBlock |
| 107 | + And I pass through the IdP |
| 108 | + And I give my consent |
| 109 | + And I pass through EngineBlock |
| 110 | + Then the url should match "/functional-testing/Easy-SP/acs" |
| 111 | + |
| 112 | + Scenario: Control - an SP behind a trusted proxy that requires Stepup LoA3 sends the user to Stepup for LoA3 |
| 113 | + Given SP "Proxy-SP" is a trusted proxy |
| 114 | + And SP "Proxy-SP" signs its requests |
| 115 | + And SP "Proxy-SP" does not require consent |
| 116 | + And SP "Target-SP" does not require consent |
| 117 | + And the SP "Target-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa3" |
| 118 | + And SP "Proxy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 119 | + And SP "Proxy-SP" is authenticating for SP "Target-SP" |
| 120 | + When I log in at "Proxy-SP" |
| 121 | + And I select "Reuse-IdP" on the WAYF |
| 122 | + And I pass through EngineBlock |
| 123 | + And I pass through the IdP |
| 124 | + Then the received AuthnRequest should match xpath '//saml:AuthnContextClassRef[text()="http://dev.openconext.local/assurance/loa3"]' |
| 125 | + |
| 126 | + Scenario: A Stepup LoA required by an SP behind a trusted proxy is not bypassed by reusing the AuthnRequest ID for it |
| 127 | + Given SP "Proxy-SP" is a trusted proxy |
| 128 | + And SP "Proxy-SP" signs its requests |
| 129 | + And SP "Proxy-SP" does not require consent |
| 130 | + And SP "Easy-SP" does not require consent |
| 131 | + And SP "Target-SP" does not require consent |
| 132 | + And the SP "Easy-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa2" |
| 133 | + And the SP "Target-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa3" |
| 134 | + And SP "Easy-SP" has the following Attribute Manipulation: |
| 135 | + """ |
| 136 | + $attributes['nl:surf:test:easy-sp'] = array("easy"); |
| 137 | + """ |
| 138 | + And SP "Target-SP" has the following Attribute Manipulation: |
| 139 | + """ |
| 140 | + $attributes['nl:surf:test:target-sp'] = array("target"); |
| 141 | + """ |
| 142 | + And SP "Proxy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 143 | + And SP "Proxy-SP" is authenticating for SP "Easy-SP" |
| 144 | + When I log in at "Proxy-SP" |
| 145 | + And I pass through EngineBlock |
| 146 | + And I pass through the IdP |
| 147 | + And I keep the Stepup "success" response for later |
| 148 | + And SP "Proxy-SP" is authenticating for SP "Target-SP" resetting the RequesterID chain |
| 149 | + And I log in at "Proxy-SP" |
| 150 | + Then I should see "Error - An error occurred" |
| 151 | + When I submit the kept Stepup response |
| 152 | + And I pass through EngineBlock |
| 153 | + Then the url should match "/functional-testing/Proxy-SP/acs" |
| 154 | + And the response should contain "nl:surf:test:easy-sp" |
| 155 | + And the response should not contain "nl:surf:test:target-sp" |
| 156 | + |
| 157 | + Scenario: The same SP behind a trusted proxy can resubmit an AuthnRequest with the same ID |
| 158 | + Given SP "Proxy-SP" is a trusted proxy |
| 159 | + And SP "Proxy-SP" signs its requests |
| 160 | + And SP "Proxy-SP" does not require consent |
| 161 | + And SP "Easy-SP" does not require consent |
| 162 | + And SP "Proxy-SP" uses AuthnRequest ID "_authnrequestidreuse00000000000000000001" |
| 163 | + And SP "Proxy-SP" is authenticating for SP "Easy-SP" |
| 164 | + When I log in at "Proxy-SP" |
| 165 | + And I log in at "Proxy-SP" |
| 166 | + And I pass through EngineBlock |
| 167 | + And I pass through the IdP |
| 168 | + And I pass through EngineBlock |
| 169 | + Then the url should match "/functional-testing/Proxy-SP/acs" |
0 commit comments