Skip to content
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

BLT should be SAML-aware in a local environment #2688

Closed
anavarre opened this issue Mar 28, 2018 · 5 comments
Closed

BLT should be SAML-aware in a local environment #2688

anavarre opened this issue Mar 28, 2018 · 5 comments
Labels
Support A support request

Comments

@anavarre
Copy link
Contributor

anavarre commented Mar 28, 2018

When you have the simplesamlphp_auth module installed locally but no Idp, Behat will just hang forever with no helpful error message when you run tests against any authenticated user role.

It's very tricky to understand what's going on. I'd thus suggest we improve the local env detection and alert one way or another when simplesamlphp_auth is enabled.

On way to work around this is to uninstall the module locally, or - as @malikkotob suggested - to have the following in local.settings.php, which indeed is more elegant.

$config['simplesamlphp_auth.settings']['activate'] = false;
@grasmash grasmash added the Support A support request label Mar 29, 2018
@grasmash
Copy link
Contributor

I think this is outside the scope of BLT. @malikkotob's suggestion is one solution. You can also disable SAML in the Behat test itself.

  Background:
    And I set the configuration item "simplesamlphp_auth.settings" with key "activate" to "false"
  Scenario: Something
    Given I am logged in as a user with the "authenticated user" role

To use that config step, you need to include the config context, which I will submit a PR for.

@anavarre
Copy link
Contributor Author

anavarre commented Mar 29, 2018

Unfortunately this doesn't work.

Background:
  And I set the configuration item "simplesamlphp_auth.settings" with key "activate" to "false"

@api
  Scenario: Something
    Given I am logged in as a user with the "authenticated user" role

First I need to prefix the Scenario with @api to invoke the Drupal API. Second, the Background will always 'pass' (not sure it's the right terminology) no matter what values you put there (could be a wrong YAML file or key)

I did ensure I had the correct Context as you advised

diff --git a/tests/behat/local.yml b/tests/behat/local.yml
index 41973c0..6c307e0 100644
--- a/tests/behat/local.yml
+++ b/tests/behat/local.yml
@@ -21,6 +21,7 @@ local:
         - Drupal\DrupalExtension\Context\MinkContext
         - Drupal\DrupalExtension\Context\MessageContext
         - Drupal\DrupalExtension\Context\DrushContext
+        - Drupal\DrupalExtension\Context\ConfigContext

@thomashowell
Copy link

The issue as I see it is that a significant portion of the sites built with BLT do indeed use SimpleSAMLphp Auth for authentication. As far as I know this is also our recommended approach for authentication. For those two reasons it seems reasonable to expect that BLT would play nicely with sites dependent on SAML.

@anavarre
Copy link
Contributor Author

@grasmash - While you've closed this issue via #2693, I'm just making sure you've seen the above comments.

@anavarre
Copy link
Contributor Author

@mikemadison13 for visibility. The below looks like horrible UX

When you have the simplesamlphp_auth module installed locally but no Idp, Behat will just hang forever with no helpful error message when you run tests against any authenticated user role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support A support request
Projects
None yet
Development

No branches or pull requests

3 participants