Skip to content

fix block for deleted basic/oauth accounts - #2175

Merged
davigonz merged 3 commits into
masterfrom
fixblock
May 23, 2018
Merged

davigonz merged 3 commits into
masterfrom
fixblock

Conversation

@theScrabi

@theScrabi theScrabi commented Apr 9, 2018 •

Copy link
Copy Markdown
Contributor

fixes #1825


BUGS & IMPROVEMENTS

@theScrabi

theScrabi commented Apr 9, 2018 •

Copy link
Copy Markdown
Contributor Author

gurken

@davigonz
davigonz self-requested a review April 11, 2018 13:51
@davigonz

Copy link
Copy Markdown
Contributor

@theScrabi there are several comments in the code, is this ready to review?

@theScrabi
theScrabi force-pushed the fixblock branch 2 times, most recently from 339fe73 to 9815486 Compare April 12, 2018 10:27
@davigonz

Copy link
Copy Markdown
Contributor

Code approved, ready to pass QA @jesmrec

@jesmrec

jesmrec commented May 2, 2018

Copy link
Copy Markdown
Member

(1)

Steps:

  1. Attach a basic auth account and open file list
  2. In web UI, remove the account
  3. Refresh account in device -> redirected to accounts list
  4. Select the removed account

Current: List of accounts again displayed. A second tap will redirect to the file list
Expected: List of files, and then again to account list.

tested with Samsung Galaxy S7

@jesmrec

jesmrec commented May 2, 2018 •

Copy link
Copy Markdown
Member

i guess there is no way to distinguish this 401 scenario (removed account) to other 401 ones. So, the user is suddenly redirected to the accounts list and he/she does not know why (for example, if the server admin removes the account). Is it correct @theScrabi ?

CC @davigonz

@davigonz

davigonz commented May 2, 2018

Copy link
Copy Markdown
Contributor

Is there no extra information in the response to distinguish 401 when removing an account from other scenarios?

@jesmrec

jesmrec commented May 2, 2018 •

Copy link
Copy Markdown
Member

Removing account in web UI, getting 401 from webdav endpoint:

<?xml version='1.0' encoding='utf-8'?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>Username or password was incorrect, Username or password was incorrect</s:message>
</d:error>

and for ocs

{
    "message": "Current user is not logged in"
}

Same error is received if the user changes password in webUI.

In case of OAuth2 token removal:

<?xml version='1.0' encoding='utf-8'?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, Bearer token was
incorrect</s:message>
</d:error>

At this point we are in the middle of an UX crossroad.

  • If we forward the user to the login view -> Blocking when an account is deleted in server side #1825
  • If we forward the user to the account list -> user is confused, so he/she does not know what happened (credentials changed, session expired, account deleted, any other kind of error...).

A solution "in the middle": show a toast/snackbar pointing to a credentials error, or showwing the message included in the body response. This would be the same solution as before, but giving the user directly the option to choose other account in his list o create a new one. This message is not very accurate, but it is better than show nothing. What do you think?

@davigonz

davigonz commented May 2, 2018

Copy link
Copy Markdown
Contributor

A solution "in the middle": show a toast/snackbar pointing to a credentials error, or showing the message included in the body response.

If we don't have more information from the server, I would go for the first option, show a toast/snackbar pointing to a credentials error.

@theScrabi

Copy link
Copy Markdown
Contributor Author

I take car about it.

@theScrabi

theScrabi commented May 3, 2018 •

Copy link
Copy Markdown
Contributor Author

I got another odd error. If you have an basic auth an an oauth account, and you remove the oauth one from the web and switch to the basic auth you will get this error:

<?xml version='1.0' encoding='utf-8'?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, Bearer token was
incorrect</s:message>
</d:error>

gurken
This is a vimeo video. Password: bla

@jesmrec I din't know if this is what you reported, but for me this looks like a different error.

PS: It does not happen if you have two basic auth accounts, and delete one of them.

@theScrabi

Copy link
Copy Markdown
Contributor Author

All right the last bug I posted #2175 (comment) is not related to this issue. Like @davigonz pointed out this error also occures if you just switch form an oauth to a basic auth account without deleting the oauth account

@theScrabi

Copy link
Copy Markdown
Contributor Author

@jesmrec I took care about that issue by showing a snack bar instead of redirecting the user when a login failed. You can actually see this behavior in the video here.

@jesmrec

jesmrec commented May 21, 2018

Copy link
Copy Markdown
Member

From the point of view of basic auth and OAuth2 it works correctly. Needs to be checked with SAML in order to know what happens when the SAML session expires.

@jesmrec

jesmrec commented May 23, 2018

Copy link
Copy Markdown
Member

Approved for basic and OAuth2, so it is ready to be used for used in Play Store

@davigonz
davigonz merged commit 0eebcfc into master May 23, 2018
@davigonz
davigonz deleted the fixblock branch May 23, 2018 07:55
@jesmrec jesmrec mentioned this pull request Jun 12, 2018
34 of 35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocking when an account is deleted in server side

3 participants