aad-for-linux / pam_aad

Azure Active Directory PAM Module
GNU General Public License v3.0
22 stars 9 forks source link

Add case insensitive option to config file #6

Open oxr463 opened 2 years ago

oxr463 commented 2 years ago
STATIC int verify_user(jwt_t * jwt, const char *username)
{
    const char *upn = jwt_get_grant(jwt, "upn");
    return (strcmp(upn, username) == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

We are accepting input from two sources without normalizing either. I.E. if John Doe was in AAD as Jdoe@example.com he would have to auth via a service with Jdoe instead of being able to use jdoe. The strcmp will fail every time due to this even though the user exists and is valid. Will push a PR to fix.

Source: https://github.com/CyberNinjas/pam_aad/issues/55