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

Authentication will fail if passwords include one or more "/" #14

Open
valluwtf opened this issue Apr 2, 2024 · 1 comment · May be fixed by #16
Open

Authentication will fail if passwords include one or more "/" #14

valluwtf opened this issue Apr 2, 2024 · 1 comment · May be fixed by #16

Comments

@valluwtf
Copy link

valluwtf commented Apr 2, 2024

Describe the bug

The slash "/" being the separator between password and OTP in stdin, things will fail if it is included as a character in the password.

Expected behavior
To allow slashes in passwords, the ReadPasswordWithOTP() function could parse the string from the back instead of the front to find the last occurence of "/". This will of course still not work if the password contains a slash but no OTP is specified.
(this is why I have not added this as a pull request)

Possibly one could check from the Keycloak API before splitting the input, to gather information about whether the user actually has OTP policy enabled or not.
Or maybe just at least warn in the documentation, since AFAIK the keycloak password policies don't offer the option to block certain characters, which could have been another possible solution

Additional context

I have changed this for our needs here, but as I said this only works when OTP policy is set to mandatory
valluwtf@2d2bbde

@kha7iq
Copy link
Owner

kha7iq commented Apr 3, 2024

Changing the character from / some other character will not solve the problem, if some one uses that in the password we will end up in the same situation again.
I will check if there is any solution for it, i am open to any suggestions or PRs. In the mean time i will highlight this in readme.

@Nithe14 Nithe14 linked a pull request Apr 5, 2024 that will close this issue
10 tasks
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

Successfully merging a pull request may close this issue.

2 participants