core
core copied to clipboard
Fix case sensitivity for app passwords/tokens
Description
Fix case sensitivity for app passwords/tokens
Related Issue
- https://github.com/owncloud/core/issues/40119
- https://github.com/owncloud/core/issues/29708
Motivation and Context
Currently, app passwords/tokens are case sensitive. That is, login will be prevented if the entered username has different case as the app password/token's username (which comes from the user's session).
How Has This Been Tested?
- Login as user
User1
and create an app password/token --> username will be automatically set toUser1
and saved as thelogin_name
in theoc_authtoken
table. - Try to authenticate by using i.e. the ownCloud desktop client with the newly generated app password/token by using
user1
as username (note the different casing):
Before this fix --> login failed with exception https://github.com/owncloud/core/blob/master/lib/private/User/Session.php#L927
After this fix --> login is correctly allowed, which is consistent with the "normal" login via username/password where usernames are case-insensitive.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Database schema changes (next release will require increase of minor version instead of patch)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Technical debt
- [ ] Tests only (no source changes)
Checklist:
- [x] Code changes
- [ ] Unit tests added
- [ ] Acceptance tests added
- [ ] Documentation ticket raised
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.
Closing this in favour of https://github.com/owncloud/core/pull/40281