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

Incorrect String Comparison of Username #47

Open
jahali25 opened this issue Sep 17, 2024 · 0 comments
Open

Incorrect String Comparison of Username #47

jahali25 opened this issue Sep 17, 2024 · 0 comments

Comments

@jahali25
Copy link

if (idToken.Username != username)

In this line,
if (idToken.Username != username)
it uses the wrong time of string comparison. It does a case-sensitive comparison. However, when you define an alias for a user on the Duo application page, it automatically causes the string to be in lower case. Thus, we should use case-insensitive comparison here. I would replace this line with
if (!string.Equals(idToken.Username, username, StringComparison.InvariantCultureIgnoreCase))
so that different casing doesn't cause an issue since Duo doesn't care about the exact casing for usernames.

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

No branches or pull requests

1 participant