Re: Can't get AccountManager plugin to display registration link

860 views
Skip to first unread message

RjOllos

unread,
Jan 4, 2013, 1:43:28 PM1/4/13
to trac-...@googlegroups.com
On Tuesday, January 1, 2013 5:56:17 PM UTC-8, mjs wrote:
I have been trying to get the AccountManager plugin to display a registration link (and to have it work) on my site's Trac pages, but without success.  I'd welcome any help or examples of a trac.ini file from a working site.

You haven't had any success getting the registration link to display? Or do you have the link displaying, but the registration page doesn't seem to be working?

I get a working registration page in a setup that follows the Cookbook steps:


So I suspect it has something to do with using HttpAuthStore.
 
This is Red Hat Enterprise Linux 6.3, Trac 0.12.4 from the EPEL RPM repository and (currently) the AccountManager plugin 0.4.2 (though I've been trying this since version 3.something with no success).

I have a global trac.ini file that each project inherits.  I'm using the HTML form for logins and that works.  The relevant sections (I think) are below.  The Web admin pages show everything enabled here as enabled.  I must be missing something simple, but I have no idea what it is.

TIA for any assistance.  Let me know if I need to supply more information.

[account-manager]
# password_file = /var/www/svn-control/coin.pwd
# password_store = HtPasswdStore
authentication_url = /authFile
password_store = HttpAuthStore

 
 [components]
acct_mgr.admin.* = enabled
acct_mgr.admin.accountmanageradminpanel = enabled
acct_mgr.api.* = enabled
acct_mgr.api.accountmanager = enabled
#acct_mgr.htfile.* = enabled
acct_mgr.htfile.abstractpasswordfilestore = disabled
acct_mgr.htfile.htdigeststore = disabled
acct_mgr.htfile.htpasswdstore = diabled
acct_mgr.http.httpauthstore = enabled
acct_mgr.pwhash.htdigesthashmethod = disabled
acct_mgr.pwhash.htpasswdhashmethod = disabled
acct_mgr.register.* = enabled
acct_mgr.register.registrationmodule = enabled
acct_mgr.register.emailverificationmodule = enabled
acct_mgr.notification.accountchangelistener = enabled
acct_mgr.web_ui.* = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled
trac.web.auth.loginmodule = disabled


You can simplify this quite a bit:

 [components]
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.htfile.* = disabled
acct_mgr.http.httpauthstore = enabled
acct_mgr.pwhash.* = disabled
acct_mgr.register.* = enabled
acct_mgr.notification.accountchangelistener = enabled
acct_mgr.web_ui.* = enabled
trac.web.auth.loginmodule = disabled


I've tried your config, and I get the following warning in the logs:

10:33:17 AM Trac[register] WARNING: RegistrationModule is disabled because the password store does not support writing.

I'm not sure what is going on yet, but could you check your logs and look for that message? See (1) if you need more info on that.

RjOllos

unread,
Jan 4, 2013, 1:51:13 PM1/4/13
to trac-...@googlegroups.com
On Tuesday, January 1, 2013 5:56:17 PM UTC-8, mjs wrote:
I have been trying to get the AccountManager plugin to display a registration link (and to have it work) on my site's Trac pages, but without success.  I'd welcome any help or examples of a trac.ini file from a working site.


"Note: This password store does not support listing/adding/removing users or changing passwords."

I really don't know much about HttpAuthStore, but you might consider changing to a different password store.

 

Steffen Hoffmann

unread,
Jan 4, 2013, 2:12:10 PM1/4/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04.01.2013 19:43, RjOllos wrote:
> So I suspect it has something to do with using HttpAuthStore.

Good point, thanks Ryan. This store indeed doesn't support writing user
account changes, so no new accounts as well, just authentication.

For making registration work, you'd indeed need a r/w-capable password
store.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDnKYkACgkQ31DJeiZFuHd2ZQCg3G3kmUXMnsjLxgLYEK7NVN0U
BY0An2CASQEaVP8FIeXsQ4oxjpAD5JGQ
=T5Vj
-----END PGP SIGNATURE-----

Steffen Hoffmann

unread,
Jan 4, 2013, 2:15:16 PM1/4/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Basically it's HTTPAuth wrapped to make it usable via HTTP login form,
including true log-out capability.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDnKkIACgkQ31DJeiZFuHcTrACg3esJ6R/yAfhIhqMTZt2xSJnP
uZYAoMDPNZSyYVnB01F9r4TtvR0RpsMt
=4Vxb
-----END PGP SIGNATURE-----

mjs

unread,
Jan 7, 2013, 1:23:48 AM1/7/13
to trac-...@googlegroups.com
Thanks for the suggestion.  I tried switching back to HtPasswdStore (which I had used before, also without success regarding registration), but the problem persists.  

I followed the example on the AccountManager page and here, so the relevant parts of trac.ini are now:

[account-manager]                                                               
password_file = /var/www/svn-control/coin.pwd                                   
password_store = HtPasswdStore                                                  
htpasswd_hash_type =     
 [components]                                                                    
acct_mgr.admin.* = enabled                                                      
acct_mgr.api.* = enabled                                                        
acct_mgr.htfile.* = disabled                                                    
acct_mgr.htfile.htpasswdstore = enabled                                         
# acct_mgr.pwhash.htpasswdhashmethod = enabled                                  
acct_mgr.register.* = enabled                                                   
acct_mgr.notification.accountchangelistener = enabled                           
acct_mgr.web_ui.* = enabled                                                     
trac.web.auth.loginmodule = disabled

Logins work with the usual httpd pop-up, but still no Register link.  The wiki page now displays this at the top:

 Warning: Error with navigation contributor "AccountModule"

which I have not seen before with any configuration I've tried.  When I attempt to log in, the log file reports

2013-01-07 01:21:20,477 Trac[chrome] ERROR: Error with navigation contributor AccountModule: AttributeError: Cannot find an implementation of the "IPasswordHashMethod" interface named "HtDigestHashMethod".  Please update the option account-manager.hash_method in trac.ini.

So I'm not sure I'm any closer.

mjs

unread,
Jan 7, 2013, 1:29:20 AM1/7/13
to trac-...@googlegroups.com
Solved the error message by including both

acct_mgr.pwhash.htpasswdhashmethod = enabled                                    
acct_mgr.pwhash.htdigesthashmethod = enabled 

But still no Register link 8^( 

mjs

unread,
Jan 7, 2013, 8:54:52 AM1/7/13
to trac-...@googlegroups.com
No, I'm wrong. Registration is now working.  Thanks everyone for your help.

Does this mean that one can't have both the login form with logouts and the registration capability?

Steffen Hoffmann

unread,
Jan 7, 2013, 3:50:46 PM1/7/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07.01.2013 14:54, mjs wrote:
> No, I'm wrong. Registration is now working. Thanks everyone for your help.
>
> Does this mean that one can't have both the login form with logouts and
> the registration capability?

What makes you think so? Of course Login and Register both can happily
co-exist in Trac's meta-navigation menu.

- From previous description of yours I've got the impression that maybe
you've setup your web-server for authentication, but only one is
required, BasicAuth/DigestAuth via web-server or AccountManager's
LoginModule, that provides the Login link you've been asking for, and
that allows to log-out and log-in as another user easily within seconds.
In practice the web-server will probably overrule LoginModule, indicated
by a HTTP auth pop-up like seen i.e. on trac-hacks.org.

Take a look at wiki documentation [1][2], if you're uncertain, an ask
away here for anything that may not be covered by the docs yet.

Steffen Hoffmann


[1] http://trac-hacks.org/wiki/AccountManagerPlugin/Modules#LoginModule
[2] http://trac-hacks.org/wiki/AccountManagerPlugin/RegistrationInspector
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDrNSQACgkQ31DJeiZFuHfewACg1HZ4PO0r/rwBqLSVttq4QCHA
SNgAoIZEB2K/7t5/k1o++OIDWDpy2tjJ
=hNUG
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages