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

Allow login with prefix of "<domain>\" for selected domains #26686

Closed

Conversation

schlimmchen
Copy link

Some WebDAV clients force to use a domain name for authentication. That domain name is prepended to the username and separated from it using a backslash.

This commit allows any user to login with a prefix of "NC", "NEXTCLOUD" or "WORKGROUP" to their username. The respective prefix is removed from the given username when trying to login if the login failed and also interpreting the given username as an email address failed.

In particular, this can help allowing access to Nextcloud for devices with an interface to SharePoint that forces to specify a domain name for authentication. As an example, HP LaserJet M428/M429 (and many others) can then "Scan to Nextcloud" by using the "Scan to SharePoint" feature (which is essentially WebDav) and configuring a domain name of "NC", "NEXTCLOUD" or "WORKGROUP".

I propose this change since I was unable to find a workaround: There seems to be no way to create user name aliases which would allow me to define "\schlimmchen" as an alias for "schlimmchen". AFAIK even the LDAP integration would not allow login with the format "<username>". Even if I found it acceptable, there is also no way to define a new user with a backslash in its username. And I could not find a way to make the printer not prefix the username by the domain (it forces the user to specify a domain).

But with this patch, one can define "NEXTCLOUD", "NC" or "WORKGROUP" as the domain in the printer/scanner, which will be stripped from the username. It is then possible to use the "Scan to SharePoint" feature to write scanned documents directly into the Nextcloud, which is just beautiful 😉

I am happy to receive feedback on this, maybe even use a completely different solution. Otherwise, this could be a useful feature for other people, too.

@szaimen szaimen added the 3. to review Waiting for reviews label Oct 9, 2022
@szaimen szaimen added this to the Nextcloud 26 milestone Oct 9, 2022
@blizzz blizzz mentioned this pull request Feb 1, 2023
@schlimmchen schlimmchen force-pushed the strip-domain-from-username branch 2 times, most recently from ca7a851 to 0c01f30 Compare February 1, 2023 19:55
@szaimen szaimen requested review from ChristophWurst, a team, ArtificialOwl, icewind1991 and blizzz and removed request for a team February 1, 2023 20:26
Some WebDAV clients force to use a domain name for authentication. That
domain name is prepended to the username and separated from it using a
backslash.

This commit allows any user to login with a prefix of "WORKGROUP\",
"NC\", or "NEXTCLOUD\" added to their username. The respective prefix is
removed from the given username when trying to login, if the login
failed using the original username. The same logic is applied when
testing login tokens.

In particular, this can help allowing access to Nextcloud for devices
with an interface to SharePoint that forces to specify a domain name for
authentication. As an example, HP LaserJet M428/M429 (and many others)
can then "Scan to Nextcloud" by using the "Scan to SharePoint" feature
(wich is essentially WebDav) and configuring a domain name of "NC",
"NEXTCLOUD" or "WORKGROUP".

Signed-off-by: Bernhard Kirchen <[email protected]>
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 7, 2023
@ChristophWurst ChristophWurst removed their request for review April 17, 2023 08:13
This was referenced May 3, 2023
@blizzz blizzz mentioned this pull request May 17, 2023
@blizzz blizzz modified the milestones: Nextcloud 27, Nextcloud 28 May 23, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@skjnldsv
Copy link
Member

Hey @schlimmchen, thanks for the Pull Request! Unfortunately, it doesn't seem to have managed to attract any attention. :(

I guess your use case is too specific :)
As there is no feedback since a while I will close this ticket.

Thanks for the interest in Nextcloud and the effort put into this! 🙇

@skjnldsv skjnldsv closed this Feb 27, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 29 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants