1

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
4

2 に答える 2

0

ここで行うように認証を混在させることはできません。

  • Apache config byAuthType Basic
  • AccountManager LoginModule(によって有効化acct_mgr.web_ui.* = enabled

これらのうちの1つだけを決定します。AcctMgrからのSSOが必要な場合は、に固執しauth_cookie_path = <all-env-common-basepath>ます。wikiページTracIniには、Tracアプリケーションのすべての有効な構成キーがあります。これは、有効なコンポーネントとインストールされているTracプラグインに応じて、Trac環境固有のものです。

于 2012-02-29T22:56:09.787 に答える
0

ダブルトリッキー。私はちょうど同じ失言を利用しました。ドキュメント (およびhasienda の回答) では、「ベースパス」について説明しています。これにより、ファイルシステム (および PHP セッションで使用されるセッションファイルのようなもの) について簡単に考えることができます。これは間違いその 1 です。trac の親環境へのURL パスです。したがって、trac プロジェクトで のようなものを使用している場合、設定は.http://www.example.org/trac/<project>auth_cookie_path = /trac

2 番目のトラップ: 古い Cookie がブラウザーに残っています。auth_cookie_path上記のように最終的に調整しましたが、それでも認証できませんでした。trac_auth私の瓶の中にあるプロジェクトの古いクッキーがありました。それを削除した後、それは魅力のように機能し始めました!

于 2013-10-08T22:35:14.817 に答える