Trac Single Signon不能像食谱中提到的那样工作

时间:2012-02-29 08:34:55

标签: trac accountmanager

我在使用subversion的多项目设置中使用Trac 0.12.3,并且正在使用来自主干的AccountManagerPlugin。默认索引页面包含所有项目目录,单击其中任何一个都会将我带到该项目的trac页面。当我尝试登录时,我已成功通过身份验证,但是,来到另一个项目需要我再次登录。我想使用单点登录并按照http://trac-hacks.org/wiki/CookBook/AccountManagerPluginConfiguration#SingleSignOn

中提到的步骤操作

总是要求我为每个项目登录。

我的apache配置:

<VirtualHost *:80>
  ServerName trac.myproject.com
  ServerAdmin your@email.com

  DocumentRoot /trac

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory />
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  ErrorLog /var/log/apache2/error.log
  LogLevel warn
  CustomLog /var/log/apache2/access.log combined
  ServerSignature On

<Location /svn>
   DAV svn
   SVNParentPath /svn

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/svnauth
   Require valid-user
   AuthzSVNAccessFile /etc/svnaccess
</Location>

<LocationMatch "/.+">
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend
   PythonOption TracEnvParentDir /trac/
   PythonOption TracUriRoot /
   #AuthType Basic
   #AuthName "Trac"
   #AuthUserFile /etc/svnauth
   #Require valid-user
</LocationMatch>

</VirtualHost>

Trac.ini文件,继承了所有其他项目特定的trac.ini文件:

[trac]
trac_auth = /trac/cookie
trac_auth_session = /trac/session
#I have also tried setting it as trac_auth_cookie = /trac/cookie
[header_logo]
alt = Logo
height = -1
link = /
src = http://projects.hostgeyser.com/templates/frost/images/logo%20250%20x%2089_new.png
width = -1

[components]
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.db.sessionstore = enabled
acct_mgr.htfile.htdigeststore = disabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.http.httpauthstore = disabled
acct_mgr.notification.* = enabled
acct_mgr.pwhash.htdigesthashmethod = disabled
acct_mgr.pwhash.htpasswdhashmethod = disabled
acct_mgr.svnserve.* = enabled
acct_mgr.svnserve.svnservepasswordstore = disabled
acct_mgr.web_ui.* = enabled
trac.web.auth.loginmodule = disabled
acct_mgr.http.httpauthstore = enabled


[account-manager]
password_store = HtPasswdStore
htpasswd_hash_type = md5
htpasswd_file = /etc/svnauth

2 个答案:

答案 0 :(得分:0)

您不能像在此处那样混合身份验证:

  • Apache AuthType Basic
  • 配置
  • AccountManager LoginModule(由acct_mgr.web_ui.* = enabled启用)

仅决定其中一项。如果您想要来自AcctMgr的SSO,请坚持auth_cookie_path = <all-env-common-basepath>。 Wiki页面 TracIni 包含Trac应用程序的所有有效配置密钥,特定于Trac环境的内容,具体取决于已启用的组件和已安装的Trac插件。

答案 1 :(得分:0)

双棘手。我只是轻拍同样的失言。文档(以及hasienda's answer)说的是“基本路径”,它可以让人们轻松地思考文件系统(以及类似PHP会话使用的会话文件)。这是第一个错误:它是 trac父环境的 URL路径因此,如果你的trac项目使用的是http://www.example.org/trac/<project>,那么你的设置必须是{{ 1}}。

第二个陷阱:浏览器中剩余的旧cookie。虽然我最终如上所述调整了我的auth_cookie_path = /trac,但仍然无法进行身份验证。我的罐子里有一个来自一个项目的旧auth_cookie_path cookie。在我删除它之后,它开始像魅力一样工作!