-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support overriding StepUp EntityId #1279
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f7e664d
GHA: Fix integration test by removing the default apache config before
quartje eabfc29
Support overriding StepUp EntityId
MKodde 57fe036
Override EntityId on outgoing AR to SA GW
MKodde 11578ad
Override stepup entityID on incoming assertion
thijskh 457260c
Update Assertion audience in mock Gateway
MKodde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
use OpenConext\EngineBlock\Exception\MissingParameterException; | ||
use OpenConext\EngineBlock\Metadata\Entity\AbstractRole; | ||
use OpenConext\EngineBlock\Metadata\Entity\IdentityProvider; | ||
use OpenConext\EngineBlock\Metadata\Entity\ServiceProvider; | ||
|
@@ -487,6 +488,32 @@ public function sendStepupAuthenticationRequest( | |
$nameIdOverwrite->setFormat(Constants::NAMEID_UNSPECIFIED); | ||
$sspMessage->setNameId($nameIdOverwrite); | ||
|
||
// See: UPGRADING.md -> ## 6.13 -> 6.14 | ||
$container = EngineBlock_ApplicationSingleton::getInstance()->getDiContainer(); | ||
$entityIdOverrideValue = $container->getStepupEntityIdOverrideValue(); | ||
$features = $container->getFeatureConfiguration(); | ||
$isConfigured = $features->hasFeature('eb.stepup.sfo.override_engine_entityid'); | ||
$isEnabled = $features->isEnabled('eb.stepup.sfo.override_engine_entityid'); | ||
|
||
if ($isEnabled && $isConfigured) { | ||
if (empty($entityIdOverrideValue)) { | ||
throw new MissingParameterException( | ||
'When feature "feature_stepup_sfo_override_engine_entityid" is enabled, | ||
you must provide the "stepup.sfo.override_engine_entityid" parameter.' | ||
); | ||
} | ||
$this->_logger->notice( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I prefer |
||
sprintf( | ||
'Feature eb.stepup.sfo.override_engine_entityid is enabled, overriding the Issuer of the AR to the ' . | ||
'StepUp Gateway. Updated the Issuer to "%s"', | ||
$entityIdOverrideValue | ||
) | ||
); | ||
$issuer = new Issuer(); | ||
$issuer->setValue($entityIdOverrideValue); | ||
$sspMessage->setIssuer($issuer); | ||
} | ||
|
||
// Link with the original Request | ||
$authnRequestRepository = new EngineBlock_Saml2_AuthnRequestSessionRepository($this->_logger); | ||
$authnRequestRepository->store($spRequest); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/OpenConext/EngineBlockFunctionalTestingBundle/Features/StepupKeyRollover.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Feature: | ||
In order to facilitate a rolling configuration update | ||
As EngineBlock | ||
I want the SP entityID that is used for Stepup auth to be configurable so that at the same time | ||
that the EngineBlock default key is updated, this entityID can be changed. | ||
This then allows two entities, with two different keys, to be configured in the Stepup-Gateway | ||
|
||
Background: | ||
Given an EngineBlock instance on "vm.openconext.org" | ||
And no registered SPs | ||
And no registered Idps | ||
And an Identity Provider named "SSO-IdP" | ||
And a Service Provider named "SSO-SP" | ||
And an Identity Provider named "Dummy-IdP" | ||
And a Service Provider named "Dummy-SP" | ||
And a Service Provider named "Proxy-SP" | ||
|
||
Scenario: When stepup.sfo.override_engine_entityid is not configured, stepup/metadata should show default EntityId | ||
Given feature "eb.stepup.sfo.override_engine_entityid" is disabled | ||
When I go to Engineblock URL "/authentication/stepup/metadata" | ||
Then the response should match xpath '//md:EntityDescriptor[@entityID="https://engine.vm.openconext.org/authentication/stepup/metadata"]' | ||
|
||
Scenario: When stepup.sfo.override_engine_entityid is configured with a valid EntityId, stepup/metadata should show that EntityId | ||
Given feature "eb.stepup.sfo.override_engine_entityid" is enabled | ||
When I go to Engineblock URL "/authentication/stepup/metadata" | ||
Then the response should match xpath '//md:EntityDescriptor[@entityID="https://engine.vm.openconext.com/new/stepup/metadata"]' | ||
|
||
# Note that we can not ascertain programatically if the Issuer is updated as this is an internal | ||
# redirect response where we can not easily intervene with the browser (we would need to disable | ||
# auto-following of redirects). This test does hit the code, and proves that the authentication | ||
# is not broken by it. | ||
Scenario: When stepup.sfo.override_engine_entityid is configured, the the Issuer is updated | ||
Given feature "eb.stepup.sfo.override_engine_entityid" is enabled | ||
And the SP "SSO-SP" requires Stepup LoA "http://vm.openconext.org/assurance/loa2" | ||
When I log in at "SSO-SP" | ||
And I select "SSO-IdP" on the WAYF | ||
And I pass through EngineBlock | ||
# This is where the Issuer is overridden. See: \EngineBlock_Corto_ProxyServer::sendStepupAuthenticationRequest | ||
And I pass through the IdP | ||
And Stepup will successfully verify a user | ||
And I give my consent | ||
And I pass through EngineBlock | ||
Then the url should match "/functional-testing/SSO-SP/acs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,4 +87,3 @@ default: | |
- "--no-sandbox" | ||
- "--disable-dev-shm-usage" | ||
Behat\Symfony2Extension: ~ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs/stepup_callout.md file refers to this section for explanation of the Engineblock config. So I think this new setting should have at least a
#
comment like the ones above.