ensky / taiga-contrib-ldap-auth

Taiga plugin for LDAP authentication
http://taiga.io
GNU Affero General Public License v3.0
54 stars 37 forks source link

I cant't login in http but in curl it's ok #34

Closed resyst-it closed 8 years ago

resyst-it commented 8 years ago

Hello,

I want to authenticate several users or in http i have this error : According to our Oompa Loompas, your username/email or password are incorrect.

Or if i test with curl all is ok i see my mail adress.

Thank you for your help.

flyingcircle commented 8 years ago

Can you provide what exactly you are providing to each and show us what your output is?

resyst-it commented 8 years ago

Yes In http i have this :

Oops, something happened...

According to our Oompa Loompas, your username/email or password are incorrect.

Whith this curl :

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "type": "ldap", "username": "username", "password": "password" }' \ http://taiga.domain/api/v1/auth

I have this result : {"photo": "//www.gravatar.com/avatar/0009a2164cdb9c4fd2a4420e7d32d192?size=80", "email": "username@domain", "max_memberships_private_projects": null, "bio": "", "big_photo": "//www.gravatar.com/avatar/0009a2164cdb9c4fd2a4420e7d32d192?size=300", "full_name_display": "username Name", "username": "my_uid_ldap", "max_private_projects": null, "full_name": "Username Name", "max_memberships_public_projects": null, "id": 5, "auth_token": "eyJ1c2VyX2F1dGhlbnRpY2F0aW9uX2lkIjo1fQ:1bLAi4:vxHCg1oCzYilb7qi8FtS7KTzYBY", "color": "#1671c3", "is_active": true, "lang": "", "total_private_projects": 0, "total_public_projects": 0, "max_public_pr

flyingcircle commented 8 years ago

Also provide your conf.json and local.py files as well

resyst-it commented 8 years ago

My local.py :

from .common import *

MEDIA_URL = "http://taiga.domain/media/"
STATIC_URL = "http://taiga.domain/static/"
ADMIN_MEDIA_PREFIX = "http://taiga.domain/static/admin/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "taiga.domain"

SECRET_KEY = "secrettaiga"

DEBUG = False
TEMPLATE_DEBUG = False
PUBLIC_REGISTER_ENABLED = False

DEFAULT_FROM_EMAIL = "no-reply@domain"
SERVER_EMAIL = DEFAULT_FROM_EMAIL

EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:Taiga@localhost:5672/taiga"}

INSTALLED_APPS += ["taiga_contrib_ldap_auth"]

LDAP_SERVER = 'ldap://ldap.domain'
LDAP_PORT = 389

#Full DN of the service account use to connect to LDAP server and search for login user's account #entry
If LDAP_BIND_DN is not specified, or is blank, then an anonymous bind is attempated
LDAP_BIND_DN = 'cn=roadmin,dc=domain,dc=com'
LDAP_BIND_PASSWORD = 'password'   # eg.
#Starting point within LDAP structure to search for login user
LDAP_SEARCH_BASE = 'dc=domain,dc=com'
#LDAP property used for searching, ie. login username needs to match value in sAMAccountName #property in LDAP
LDAP_SEARCH_PROPERTY = 'uid'
LDAP_SEARCH_SUFFIX = None # '@example.com'

#Names of LDAP properties on user account to get email and full name
LDAP_EMAIL_PROPERTY = 'mail'
LDAP_FULL_NAME_PROPERTY = 'cn'

And this is my conf.json :

{
    "api": "http://taiga.domain/api/v1/",
    "eventsUrl": "ws://taiga.domain/events",
    "eventsMaxMissedHeartbeats": 5,
    "eventsHeartbeatIntervalTime": 60000,
    "debug": true,
    "debugInfo": false,
    "defaultLanguage": "en",
    "themes": ["taiga"],
    "defaultTheme": "taiga",
    "publicRegisterEnabled": false,
    "feedbackEnabled": true,
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "maxUploadFileSize": null,
    "loginFormType": "ldap",
    "contribPlugins": []
}
flyingcircle commented 8 years ago

Hmm I'm not really sure what's going wrong. I would double check your circus/gunicorn/nginx log files for any errors that have popped up, and also double check that they are all written as intended. Feel free to post any particular error you see in those logs.

resyst-it commented 8 years ago

I have no errors in log file. And i have no error log file for circus : gunicorn.stderr.log

Trying import local.py settings...
Trying import local.py settings...
Trying import local.py settings...
[2016-07-07 14:18:52 +0000] [10755] [INFO] Shutting down: Master
[2016-07-07 14:18:53 +0000] [13229] [INFO] Starting gunicorn 19.4.5
[2016-07-07 14:18:53 +0000] [13229] [INFO] Listening at: http://127.0.0.1:8001 (13229)
[2016-07-07 14:18:53 +0000] [13229] [INFO] Using worker: sync
[2016-07-07 14:18:53 +0000] [13232] [INFO] Booting worker with pid: 13232
[2016-07-07 14:18:53 +0000] [13234] [INFO] Booting worker with pid: 13234
[2016-07-07 14:18:53 +0000] [13236] [INFO] Booting worker with pid: 13236
[2016-07-07 14:36:08 +0000] [13229] [INFO] Handling signal: term
Trying import local.py settings...
Trying import local.py settings...
Trying import local.py settings...
[2016-07-07 14:36:09 +0000] [13229] [INFO] Shutting down: Master
[2016-07-07 14:36:09 +0000] [16293] [INFO] Starting gunicorn 19.4.5
[2016-07-07 14:36:09 +0000] [16293] [INFO] Listening at: http://127.0.0.1:8001 (16293)
[2016-07-07 14:36:09 +0000] [16293] [INFO] Using worker: sync
[2016-07-07 14:36:09 +0000] [16296] [INFO] Booting worker with pid: 16296
[2016-07-07 14:36:10 +0000] [16298] [INFO] Booting worker with pid: 16298
[2016-07-07 14:36:10 +0000] [16300] [INFO] Booting worker with pid: 16300

My circus.ini :

[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
statsd = true

[watcher:taiga]
working_dir = /home/taiga/taiga-back
cmd = gunicorn
args = -w 3 -t 60 --pythonpath=. -b 127.0.0.1:8001 taiga.wsgi
uid = taiga
numprocesses = 1
autostart = true
send_hup = true
stdout_stream.class = FileStream
stdout_stream.filename = /home/taiga/logs/gunicorn.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 4
stderr_stream.class = FileStream
stderr_stream.filename = /home/taiga/logs/gunicorn.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 4

[env:taiga]
PATH = /home/taiga/.virtualenvs/taiga/bin:$PATH
TERM=rxvt-256color
SHELL=/bin/bash
USER=taiga
LANG=en_US.UTF-8
HOME=/home/taiga
PYTHONPATH=/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages

[watcher:taiga-events]
working_dir = /home/taiga/taiga-events
cmd = /usr/local/bin/coffee
args = index.coffee
uid = taiga
numprocesses = 1
autostart = true
send_hup = true
stdout_stream.class = FileStream
stdout_stream.filename = /home/taiga/logs/taigaevents.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 12
stderr_stream.class = FileStream
stderr_stream.filename = /home/taiga/logs/taigaevents.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 12
resyst-it commented 8 years ago

Do you have an idea ?

Thank you.

flyingcircle commented 8 years ago

The only other thing I can think to even look at would be your nginx files. The log if there is anything of note and the conf files

resyst-it commented 8 years ago

Ok i reboot my server and it's ok now. But i reboot all the taiga process before reboot my server. What is the process that I have to restart ?

Thanks for your help.

flyingcircle commented 8 years ago

There's a page on taiga explaining how to reset, but from memory I believe it is circusctl taiga restart. You'll have to double check it though.