[GH-ISSUE #8] Username normalisation #5

Closed
opened 2026-03-13 14:27:56 +03:00 by kerem · 5 comments
Owner

Originally created by @karelvins on GitHub (Feb 12, 2024).
Original GitHub issue: https://github.com/abbas-gheydi/radotp/issues/8

Hello, it would be nice to have an option for username "normalisation":

  • case-sensitivity (or it could handle all user names in lowercase and no option is needed)
  • domain striping from user name - users sometimes types domain\user.name or user.name@domain.com.

Thank you.

Karel

Originally created by @karelvins on GitHub (Feb 12, 2024). Original GitHub issue: https://github.com/abbas-gheydi/radotp/issues/8 Hello, it would be nice to have an option for username "normalisation": - case-sensitivity (or it could handle all user names in lowercase and no option is needed) - domain striping from user name - users sometimes types domain\user.name or user.name@domain.com. Thank you. Karel
kerem closed this issue 2026-03-13 14:28:01 +03:00
Author
Owner

@abbas-gheydi commented on GitHub (Feb 12, 2024):

Hi Karel,

Thanks for bringing this up! Just wanted to let you know that the latest release, version 2.1.0, addresses those issues.

Here's what's changed:

Case Sensitivity Handling: Usernames are now uniformly processed in lowercase, so no need to worry about case sensitivity causing any hiccups.

Domain Stripping: Users can input their usernames with or without domain prefixes (e.g., domain\username or username@domain.com), and the system will intelligently strip out the unnecessary parts.

These improvements are aimed at enhancing the user experience and streamlining the authentication process. If you have any further feedback or encounter any issues, feel free to reach out.

Thanks again for your input!

<!-- gh-comment-id:1939529423 --> @abbas-gheydi commented on GitHub (Feb 12, 2024): Hi Karel, Thanks for bringing this up! Just wanted to let you know that the latest release, version 2.1.0, addresses those issues. Here's what's changed: Case Sensitivity Handling: Usernames are now uniformly processed in lowercase, so no need to worry about case sensitivity causing any hiccups. Domain Stripping: Users can input their usernames with or without domain prefixes (e.g., domain\username or username@domain.com), and the system will intelligently strip out the unnecessary parts. These improvements are aimed at enhancing the user experience and streamlining the authentication process. If you have any further feedback or encounter any issues, feel free to reach out. Thanks again for your input!
Author
Owner

@karelvins commented on GitHub (Feb 12, 2024):

There could be some problem with the domain\username handling. Case sensitivity is OK, @doman striping works OK, but domain\username:

radotp-1 | 2024/02/12 21:55:26 received a radius packet for user: domain\karel.vins
radotp-1 |
radotp-1 | 2024/02/12 21:55:26 /pkgs/storage/postgres_otp.go:112 record not found
radotp-1 | [0.596ms] [rows:0] SELECT * FROM "otps" WHERE Username = 'domain' ORDER BY "otps"."id" LIMIT 1
radotp-1 | 2024/02/12 21:55:26 Access-Reject to XXXXXXXX:29480 for domain\karel.vins stage otp

It will take domain instead of username...

Thank you

Karel

<!-- gh-comment-id:1939660490 --> @karelvins commented on GitHub (Feb 12, 2024): There could be some problem with the domain\username handling. Case sensitivity is OK, @doman striping works OK, but domain\username: radotp-1 | 2024/02/12 21:55:26 received a radius packet for user: domain\karel.vins radotp-1 | radotp-1 | 2024/02/12 21:55:26 /pkgs/storage/postgres_otp.go:112 record not found radotp-1 | [0.596ms] [rows:0] SELECT * FROM "otps" WHERE Username = 'domain' ORDER BY "otps"."id" LIMIT 1 radotp-1 | 2024/02/12 21:55:26 Access-Reject to XXXXXXXX:29480 for domain\karel.vins stage otp It will take domain instead of username... Thank you Karel
Author
Owner

@karelvins commented on GitHub (Feb 12, 2024):

Maybe here:

func (p postgresOtp) Get(username string) (password string, err error) {
username = strings.ToLower(username)
if strings.Contains(username, "\") {
splitChar := "\"
username = strings.Split(username, splitChar)[0] <------------------- should be [1] ?

<!-- gh-comment-id:1939680155 --> @karelvins commented on GitHub (Feb 12, 2024): Maybe here: func (p postgresOtp) Get(username string) (password string, err error) { username = strings.ToLower(username) if strings.Contains(username, "\\") { splitChar := "\\" username = strings.Split(username, splitChar)[0] <------------------- should be [1] ?
Author
Owner

@abbas-gheydi commented on GitHub (Feb 13, 2024):

The issue with pre-Windows 2000 logon for usernames has been resolved in version 2.1.1.

Thanks to the contributor who raised the issue – your input is invaluable in improving the project.

If you encounter any further issues, feel free to report them. Your feedback helps me maintain the quality of the project.

Thank you

Abbas

<!-- gh-comment-id:1941920012 --> @abbas-gheydi commented on GitHub (Feb 13, 2024): The issue with pre-Windows 2000 logon for usernames has been resolved in version 2.1.1. Thanks to the contributor who raised the issue – your input is invaluable in improving the project. If you encounter any further issues, feel free to report them. Your feedback helps me maintain the quality of the project. Thank you Abbas
Author
Owner

@karelvins commented on GitHub (Feb 13, 2024):

Thank you, 2.1.1 is working fine.

<!-- gh-comment-id:1942148501 --> @karelvins commented on GitHub (Feb 13, 2024): Thank you, 2.1.1 is working fine.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/radotp#5
No description provided.