Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13899 closed defect (worksforme)

AccountManagerPlugin working with apache but not with default login

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords: Login HTTPS Apache trac.ini
Cc: Trac Release: 0.11

Description

I'm on a Centos 7 machine and I'm trying to match the trac.ini with the .htpasswd so I can log in to my aplication, but im not getting any success. I can say that the trac.ini is kinda working because my database is also allocated there and i can access to it without problems.

If I write directy on the apache.conf my own Location to identify the .httpasswd, I can access without problems.

trac.ini:

[account-manager]
password_file = /var/www/html/trac/conf/.htpasswd
password_format = htpasswd
password_store = HtPasswdStore

If I decide to enable the apache auth login:

<Location /myproject>
        AuthType Basic
        AuthName trac
        AuthUserFile /var/www/html/trac/conf/.htpasswd
        Require valid-user
</Location>

For some reason, the authname is not getting detected (on trac/web/auth.py), so when I try to logout it displays the following error:

File "/usr/lib/python2.7/site-packages/Trac-0.11dev_r560-py2.7.egg/trac/web/main.py", line 457, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.7/site-packages/Trac-0.11dev_r560-py2.7.egg/trac/web/main.py", line 204, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 538, in process_requestFile "/usr/lib/python2.7/site-packages/Trac-0.11dev_r560-py2.7.egg/trac/web/auth.py", line 116, in process_request
  self._do_logout(req)        
File "/usr/lib/python2.7/site-packages/Trac-0.11dev_r560-py2.7.egg/trac/web/auth.py", line 174, in _do_logout
  auth_cookie = req.incookie['trac_auth'].value

Attachments (0)

Change History (9)

comment:1 Changed 4 years ago by Ryan J Ollos

If you are authenticating via Apache, you should leave Trac's LoginModule enabled and disable TracAccountManager's LogingModule: AccountManagerPlugin/Modules#LoginModule.

comment:2 Changed 4 years ago by Ryan J Ollos

Status: newaccepted

comment:3 Changed 4 years ago by anonymous

I would like to enable the Trac form authenticator, I have already enabled the LoginModule and disabled the trac.web.auth.LoginModule.

[components]
acct_mgr.* = enabled
customfieldadmin.api.customfields = enabled
customfieldadmin.customfieldadmin.customfieldadminpage = enabled
trac.ticket.query.querymodule = enabled
trac.ticket.report.reportmodule = enabled
trac.web.auth.loginmodule = disabled
trac.wiki.web_ui.wikimodule = disabled
traccc.* = enabled
traccc.admin.tracccwebadmin = disabled
traccc.traccc.cruisecontrolplugin = disabled
tracdownloader.admin.downloaderadminpage = disabled
tracdownloader.web_ui.downloadermodule = disabled
webadmin.* = enabled

comment:4 Changed 4 years ago by Ryan J Ollos

You'll need to remove Apache authentication (the <Location /myproject> block) if you want to use form login.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

comment:5 Changed 4 years ago by anonymous

i've removed it, but still doesnt work, when I write the user and password it doesnt enter into the application(it's like it doesnt take the .htpasswd file).

comment:6 Changed 4 years ago by anonymous

I've got the fix, the problem was the .htpasswd, I passed it from a Windows machine to a Linux, and for some reason the codification is not the same. Is there any way to parse the users to a linux machine?

comment:7 Changed 4 years ago by Ryan J Ollos

My first guess would be the end-of-line characters. We'll have to take a look at that.

comment:8 in reply to:  7 Changed 4 years ago by anonymous

Replying to Ryan J Ollos:

My first guess would be the end-of-line characters. We'll have to take a look at that.

Thanks for the answer, I used notepad++ on windows to change the OEL(edit>EOL Conversion>UNIX/OSX Format) to UNIX, now everything works.

Thank you for your time.

comment:9 Changed 4 years ago by Ryan J Ollos

Resolution: worksforme
Status: acceptedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.