You are here

class ServerVariableLookup in LDAP Single Sign On 8.4

Same name in this branch
  1. 8.4 src/ServerVariableLookup.php \Drupal\ldap_sso\ServerVariableLookup
  2. 8.4 tests/modules/ldap_sso_dummy_ldap/src/ServerVariableLookup.php \Drupal\ldap_sso_dummy_ldap\ServerVariableLookup

Helper function to make dummy data available in functional tests.

Hierarchy

Expanded class hierarchy of ServerVariableLookup

1 string reference to 'ServerVariableLookup'
ldap_sso_dummy_ldap.services.yml in tests/modules/ldap_sso_dummy_ldap/ldap_sso_dummy_ldap.services.yml
tests/modules/ldap_sso_dummy_ldap/ldap_sso_dummy_ldap.services.yml
1 service uses ServerVariableLookup
ldap_sso.server_variable in tests/modules/ldap_sso_dummy_ldap/ldap_sso_dummy_ldap.services.yml
Drupal\ldap_sso_dummy_ldap\ServerVariableLookup

File

tests/modules/ldap_sso_dummy_ldap/src/ServerVariableLookup.php, line 12

Namespace

Drupal\ldap_sso_dummy_ldap
View source
class ServerVariableLookup implements ServerVariableLookupInterface {

  /**
   * {@inheritdoc}
   */
  public function getAuthenticationNameFromServer(?string $variable) : ?string {
    $remote_user = NULL;

    // @todo Make this path checking more robust.
    if (strpos($_SERVER['REQUEST_URI'], '/user/login/sso') !== FALSE) {
      $remote_user = 'hpotter';
    }
    return $remote_user;
  }

}

Members