Skip to content

Commit

Permalink
Test disabling the unsolicited sso
Browse files Browse the repository at this point in the history
1. The TestFeatureConfiguration missed the default setting. Causing some
   of the behat tests to fail (the ones running the check in the
   controller)
2. I added a dedicated test that tests if the flag can disable the
   unsolicited sso flow

See: #1312
  • Loading branch information
MKodde committed Aug 27, 2024
1 parent 06eed2e commit 2de1a17
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct()
$this->setFeature(new Feature('eb.feature_enable_consent', true));
$this->setFeature(new Feature('eb.enable_sso_session_cookie', true));
$this->setFeature(new Feature('eb.stepup.sfo.override_engine_entityid', false));
$this->setFeature(new Feature('eb.feature_enable_idp_initiated_flow', true));
}

public function setFeature(Feature $feature): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ Feature:
And the response should contain "Motivation for affiliation"
And the response should contain "Motivation for orcid"

Scenario: The user is presented with an institution provided consent text
Given I log in at "Dummy-SP"
And the IdP "Dummy-IdP" provides a consent message "Institutional privacy message" for SP "Dummy-SP"
And I pass through EngineBlock
And I pass through the IdP
Then the response should contain "Institutional privacy message"

Scenario: The user can reload the consent screen without error
Given I log in at "Dummy-SP"
And I pass through EngineBlock
Expand All @@ -95,6 +88,13 @@ Feature:
When I reload the page
Then the response should contain "Proceed to Dummy-SP"

Scenario: The user is presented with an institution provided consent text
Given I log in at "Dummy-SP"
And the IdP "Dummy-IdP" provides a consent message "Institutional privacy message" for SP "Dummy-SP"
And I pass through EngineBlock
And I pass through the IdP
Then the response should contain "Institutional privacy message"

Scenario: The user sees the identifier section when nameid is persistent
Given SP "Dummy-SP" uses the Persistent NameID format
And I log in at "Dummy-SP"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Feature:
In order to disable unsolicited single sign On
As an administrator
I want to be able to disable unsolicited login

Background:
Given an EngineBlock instance on "vm.openconext.org"
And feature "eb.feature_enable_idp_initiated_flow" is disabled
And no registered SPs
And no registered Idps
And an Identity Provider named "Dummy IdP"
And a Service Provider named "Dummy SP"

# The feature flag: eb.feature_enable_idp_initiated_flow can disable unsolicited login
# EB Shows a 404 page in that case as the entire HTTP route is blocked in that case
Scenario: Engine disallows unsolicited login
When An IdP initiated Single Sign on for SP "Dummy SP" is triggered by IdP "Dummy IdP"
Then I should see "404 - Page not found"
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ services:
arguments:
- "@engineblock.mock_clients.mock_stepup_gateway"
- "@twig"

engineblock.controller.authentication.identity_provider:
class: OpenConext\EngineBlockBundle\Controller\IdentityProviderController
arguments:
- "@engineblock.compat.application"
- "@twig"
- "@engineblock.compat.logger"
- "@engineblock.service.request_access_mailer"
- "@engineblock.validator.sso_request_validator"
- "@engineblock.validator.saml_binding_validator"
- "@engineblock.validator.unsolicited_sso_request_validator"
- "@engineblock.service.authentication_state_helper"
- "@engineblock.functional_testing.fixture.features"

0 comments on commit 2de1a17

Please sign in to comment.