simplesamlphp / simplesamlphp/simplesamlphp-module-radius

RADIUS authentication is retried at secondary server even if first server returned Auth Failure

Ouverte
#35 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
PHP
Étoiles
2
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

We have configured two RADIUS servers for failover. Recently, I noticed that failed authentications from the primary are immediately re-asked at the secondary server (which still generates and Auth failure, so the end result is consistent and no harm done).

But there's really no point in asking the failover server if the primary is sure that the auth failed.

Looking at the code, I found a logic error here:

https://github.com/simplesamlphp/simplesamlphp-module-radius/blob/27d7591603dd2665a147857a4f8adcd33eb6d6cf/src/Auth/Source/Radius.php#L167

The code considers the RADIUS query successful only if it returns not-false.

The underlying library returns sth not-false only in case the authentication succeeded. Notably, a failed authentication is as "false" as a protocol error. See the return paths of its function: they are either outright "false" or compare whether the authentication was a success:

https://github.com/dapphp/radius/blob/master/src/Radius.php#L1752

I.e. error conditions and a negative outcome both have the same result; and the calling module in SSP will loop over all configured servers in both cases. Only a positive result breaks out of the loop.

Ideally, a confirmed negative result from the primary authentication server should be taken as-is.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par src/Auth/Source/Radius.php vers la ligne 167 et examinez les chemins de retour référencés dans src/Radius.php de dapphp/radius vers la ligne 1752. Vérifiez comment sont représentés les échecs d’authentification et les erreurs de protocole, puis ajoutez des tests montrant qu’un refus primaire confirmé n’est pas réessayé, tandis qu’une erreur peut toujours déclencher un failover.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
php
Domaine
authentication, backend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.