core icon indicating copy to clipboard operation
core copied to clipboard

Fix case sensitivity for app passwords/tokens

Open pako81 opened this issue 2 years ago • 2 comments

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?

  1. Login as user User1 and create an app password/token --> username will be automatically set to User1 and saved as the login_name in the oc_authtoken table.
  2. 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

pako81 avatar Aug 10 '22 13:08 pako81

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.

update-docs[bot] avatar Aug 10 '22 13:08 update-docs[bot]

Closing this in favour of https://github.com/owncloud/core/pull/40281

pako81 avatar Aug 10 '22 20:08 pako81