プロジェクト

全般

プロフィール

Vote #71777

完了

Allow "Stay logged in" from multiple browsers

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Accounts / authentication_7
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
7
version_id:
119
issue_org_id:
10840
author_id:
54998
assigned_to_id:
1
comments:
14
status_id:
5
tracker_id:
2
plus1:
3
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I regularly access my project's Redmine site from several different browsers on a couple of different computers. Even though I've checked "stay logged in" on all these browsers, as soon as I log into my site from any one browser I'm effectively logged out on all the others. The next time I access Redmine from a different browser, I have to log in again. This is quite inconvenient.

It would be much nicer if the autologin timeout (which I have set to 30 days) applied to every browser from which I access Redmine, independently.


journals

+1
--------------------------------------------------------------------------------
+1 Agreed.

"Stay logged in" is a joke a it is. Keeps making me log in within 5mins of my last login. Apparently, it's the session cookie policy that needs changing to allow for multiple sessions per user?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I access Redmine via Firefox, but MS Outlook loads pictures from Redmine via Internet Explorer. So if I log in from Firefox, I can't see pictures in confirmation letters.
--------------------------------------------------------------------------------
Must have for proper mobile usage where you switch 5 times a day between mobile phone, notebook and desktop PC.
--------------------------------------------------------------------------------
I have added two alternative patches, which implement this feature.

The first one (0001-10840-allow-stay-logged-in-from-multiple-browsers.patch) makes use of the features introduced in r14735. It allows 10 concurrent autologin tokens per user, updates the tests accordingly and does not change anything else.

---------------------

The second one (0001-Define-token-action-properties-explicitly.patch) refactors the token class.

*To ease review*, I kept the original patch series which lead to the proposed solution "on GitHub":https://github.com/schmidt/redmine/compare/master...issue/10840-refactoring.

*Motivation:* Token actions within Redmine have a defined lifetime and a maximum number of instances per user. These are defined within the current code base (session - 1 day, 10 instances; autologin - Setting.autologin.days, 1 instance, api - does not expire, 1 instance; ...), but the configuration is not made explicitly. Instead it is spread across multiple methods within the Token class. This makes it tedious to change the properties of a certain token action and, more importantly, it makes it difficult to reuse the token class from plugin code, without the need to override Token methods. In the current code base, non-core tokens will always expire after 1 day and there may only be one token per action/user. If a plugin would need a token more similar to the session or api token, it would need to override multiple methods within app/models/token.rb to achieve the desired effect.

*Approach*: The refactoring adds an explicit configuration for the diffent exisiting token actions, using the properties, that are currently in use. It then changes the action related methods within the Token class, to use the configured properties instead of the hard coded approach used earlier. This way, the list of actions may be extended by plugins, without the need to change core methods.

*Changes*: In order to solve this issue, the proposed patch, sets the maximum number of instances of the autologin token to 10 - similar to the session tokens.

*Fixes*: Previously @Token.destroy_expired@ would delete perfectly valid autologin tokens, when @Settings.autologin != "1"@. The proposed patch fixes that bug.

--------------------------------------------------------------------------------
As far as I can tell, #6120 is a duplicate of this issue.
--------------------------------------------------------------------------------
As heavy plugin developers, we've ran into this a few times already. The proposed patch would be a great improvement for plugins, so I'm (boldly) pushing this for a next major release ;-)
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
The current behavior makes working with both desktop and a mobile device really annoying. I wonder why this does not get more attention.
--------------------------------------------------------------------------------
I have tested the patch attachment:0001-10840-allow-stay-logged-in-from-multiple-browsers.patch. It works fine as expected. Setting target version to 3.4.0.

Unfortunately 0001-Define-token-action-properties-explicitly.patch cannot be applied to the current trunk cleanly, I have not tested yet.
--------------------------------------------------------------------------------
I have updated the other patch (with the included refactoring) to the current trunk r16138. I would be glad if you could take a second look.

The patch series, which led to the proposed changes, is still available "on GitHub":https://github.com/schmidt/redmine/compare/master...issue/10840-refactoring for easier review, and has been updated as well.
--------------------------------------------------------------------------------
The refactoring patch is committed, thanks. Followed by a fix for SQL errors with PostgreSQL (@Token.invalid_when_created_before@ was never returning nil making @next if validity_time.nil?@ useless).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,26617,stop Concurrent season
duplicates,Closed,6120,keep autologin cookie with several web browsers

Admin Redmine さんが約4年前に更新

  • カテゴリAccounts / authentication_7 にセット
  • 対象バージョン3.4.0_119 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0