Skip to content

Commit

Permalink
Oauth: case insensitive username compare
Browse files Browse the repository at this point in the history
(cherry picked from commit 67ff79e)
(cherry picked from commit 12e06aa)
  • Loading branch information
TheOneRing committed Jul 6, 2022
1 parent caf41a6 commit 6337d23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/5174
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Compare usernames case insensitive

We fixed a bug where the user name was compared with the name provided by the server in a case sensitive way.

https://github.com/owncloud/enterprise/issues/5174
3 changes: 2 additions & 1 deletion src/libsync/creds/oauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ void OAuth::refreshAuthentication(const QString &refreshToken)
void OAuth::finalize(const QPointer<QTcpSocket> &socket, const QString &accessToken,
const QString &refreshToken, const QString &user, const QUrl &messageUrl)
{
if (!_account->davUser().isNull() && user != _account->davUser()) {
// dav user names are case insensetive, we might compare a user input with the string provided by the server
if (!_account->davUser().isEmpty() && user.compare(_account->davUser(), Qt::CaseInsensitive) != 0) {
// Connected with the wrong user
qCWarning(lcOauth) << "We expected the user" << _account->davUser() << "but the server answered with user" << user;
const QString message = tr("<h1>Wrong user</h1>"
Expand Down

0 comments on commit 6337d23

Please sign in to comment.