特拉克+ AccountManagerPlugin:如何让 cookie 共享正常工作?
我有一个包含多个项目的活动 Trac 安装。我使用 AccountManagerPlugin 来管理用户帐户,并允许用户管理自己的帐户。
我当前的 AccountManagerPlugin 配置如下所示:
[account-manager]
account_changes_notify_addresses =
authentication_url =
force_passwd_change = true
generated_password_length = 8
hash_method = HtDigestHashMethod
htdigest_realm = TracRealm
notify_actions = []
password_file = /home/sms/trac_sites/trac.htdigest
password_store = HtDigestStore
persistent_sessions = true
user_lock_max_time = 0
verify_email = false
这非常有效,除了:每个 Trac 项目当前都需要单独的身份验证。 这些项目无法共享其身份验证 cookie。
设置auth_cookie_path = /trac
不起作用,因为会话数据存储在每个项目自己的数据库中;因此,一个项目无法验证另一个项目的 cookie。更糟糕的是,这会导致项目覆盖彼此的 cookie。
使用未记录的两岁猴子补丁(SharedCookieAuthPlugin)似乎是一个坏主意。
有解决办法吗?
I have an active Trac installation with multiple projects. I am using the AccountManagerPlugin to manage user accounts, and to allow users to manage their own accounts.
My current AccountManagerPlugin configuration looks like this:
[account-manager]
account_changes_notify_addresses =
authentication_url =
force_passwd_change = true
generated_password_length = 8
hash_method = HtDigestHashMethod
htdigest_realm = TracRealm
notify_actions = []
password_file = /home/sms/trac_sites/trac.htdigest
password_store = HtDigestStore
persistent_sessions = true
user_lock_max_time = 0
verify_email = false
This works great, except: Each Trac project currently requires separate authentication. The projects are unable to share their authentication cookies.
Setting auth_cookie_path = /trac
does not work, because session data is stored in each project's own database; therefore one project cannot validate the cookie of another. Worse, this causes projects to overwrite each other's cookies.
Using an undocumented two-year-old monkey patch (SharedCookieAuthPlugin) seems like a bad idea.
Is there a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SharedCookieAuthPlugin 确实是可行的方法。该插件的作者(k0s,别名 Jeff Hammel)是请求
的人auth_cookie_path
选项,专门针对他的插件。事实上,它已经两年没有更新了,这仅仅意味着它可以按原样运行。SharedCookieAuthPlugin is indeed the way to go. The author of the plugin (k0s, alias Jeff Hammel) was the person who requested the
auth_cookie_path
option, specifically for his plugin. The fact that it hasn't been updated in two years just means that it works as it is.