tmail-flutter icon indicating copy to clipboard operation
tmail-flutter copied to clipboard

Fix mobile app force logout when notification enable in OIDC

Open dab246 opened this issue 10 months ago • 7 comments

Issue

  • App more than 2 minutes (expired time)
  • When enable notification + OIDC, app sometimes have forced logout

Root cause

  • Because multiple requests are called at the same time. Because of using QueueInterceptor, requests are completed according to the FIFO principle. But because they are all called at the same time, the data in the request is still the old data (AuthorizationHeader). Therefore, when the first request gets the new token and uses it, the following requests will not be able to use this new token, leading to errors.

Solution

Perform verification for requests by checking:

  • AuthorizationHeader
  • Token Expired

dab246 avatar Mar 28 '24 07:03 dab246

This PR has been deployed to https://linagora.github.io/tmail-flutter/2751.

github-actions[bot] avatar Mar 28 '24 08:03 github-actions[bot]

What is the user impact of this work?

chibenwa avatar Apr 04 '24 06:04 chibenwa

What is the user impact of this work?

Mobile user need to go to login screen.

  • Right now, still not get any feedback on it, dev team found this

hoangdat avatar Apr 04 '24 06:04 hoangdat

Because on CNB users complains that after some time, need to reinstall the application. I strongly suspect a refresh token handling issue on mobile...

chibenwa avatar Apr 04 '24 06:04 chibenwa

Because on CNB users complains that after some time, need to reinstall the application. I strongly suspect a refresh token handling issue on mobile...

reinstall the application ? I think it should be login again, right? If so, IMO, it's related to the issue being fixed in this PR

dab246 avatar Apr 04 '24 07:04 dab246

I was not able to reproduce that myself but apparently they were not redirected back to the OIDC provider...

chibenwa avatar Apr 04 '24 12:04 chibenwa

I was not able to reproduce that myself but apparently they were not redirected back to the OIDC provider...

you test on linagora or customer platform?

hoangdat avatar Apr 04 '24 15:04 hoangdat

Does this affects CNB too ?

guimard avatar Apr 27 '24 04:04 guimard

Well this might be the bug i encoutered friday...

chibenwa avatar Apr 28 '24 13:04 chibenwa