You are here

protected function LoginValidatorBase::additionalDebuggingResponse in Lightweight Directory Access Protocol (LDAP) 8.4

Provides formatting for authentication failures.

Parameters

int $authenticationResult: Case.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup Response text.

2 calls to LoginValidatorBase::additionalDebuggingResponse()
LoginValidatorLoginForm::testCredentials in ldap_authentication/src/Controller/LoginValidatorLoginForm.php
Credentials are tested.
LoginValidatorSso::testCredentials in ldap_authentication/src/Controller/LoginValidatorSso.php
@todo Reduce code duplication w/ LoginValidator, split this function up.

File

ldap_authentication/src/Controller/LoginValidatorBase.php, line 412

Class

LoginValidatorBase
Handles the actual testing of credentials and authentication of users.

Namespace

Drupal\ldap_authentication\Controller

Code

protected function additionalDebuggingResponse(int $authenticationResult) : TranslatableMarkup {
  switch ($authenticationResult) {
    case self::AUTHENTICATION_FAILURE_FIND:
      $information = $this
        ->t('(not found)');
      break;
    case self::AUTHENTICATION_FAILURE_CREDENTIALS:
      $information = $this
        ->t('(wrong credentials)');
      break;
    case self::AUTHENTICATION_SUCCESS:
      $information = $this
        ->t('(no issue)');
      break;
    default:
      $information = $this
        ->t('(unknown issue)');
  }
  return $information;
}