{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/pepper/issues/63","labels_url":"https://api.github.com/repos/saltstack/pepper/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/pepper/issues/63/comments","events_url":"https://api.github.com/repos/saltstack/pepper/issues/63/events","html_url":"https://github.com/saltstack/pepper/issues/63","id":117404058,"number":63,"title":"Error using LDAP","user":{"login":"PierreR","id":93115,"avatar_url":"https://avatars.githubusercontent.com/u/93115?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreR","html_url":"https://github.com/PierreR","followers_url":"https://api.github.com/users/PierreR/followers","following_url":"https://api.github.com/users/PierreR/following{/other_user}","gists_url":"https://api.github.com/users/PierreR/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreR/subscriptions","organizations_url":"https://api.github.com/users/PierreR/orgs","repos_url":"https://api.github.com/users/PierreR/repos","events_url":"https://api.github.com/users/PierreR/events{/privacy}","received_events_url":"https://api.github.com/users/PierreR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-17T17:17:49Z","updated_at":"2015-11-17T20:20:08Z","closed_at":null,"body":"I have just switched from `pam` to `ldap` and I get the following error:\r\nPepper error: Server error.\r\nHere is the configuration for `pepper`:\r\n```\r\nSALTAPI_USER=name\r\nSALTAPI_PASS=pass\r\nSALTAPI_URL=https://saltmaster.sandbox.srv.lan:8000\r\nSALTAPI_EAUTH=ldap\r\n```\r\nOn the salt master, everything works as expected which means the ldap configuration on the master is correct:\r\n` salt –a ldap '*' test.ping`\r\n\r\nThe salt-api, does return me a valid token when I use:\r\n```\r\ncurl -sS -i -k -H 'Content-Type: application/json' -d '[{\"eauth\":\"ldap\",\"username\":\"user\",\"password\":\"pass\",\"client\":\"local\",\"tgt\":\"*\",\"fun\":\"test.ping\"}]' https://localhost:8000/login\r\n```\r\nAlthough the following command\r\n```\r\ncurl -ksi https://localhost:8000 -H \"Accept: application/x-yaml\" -H \"X-Auth-Token: 2f663bdf9680e59df1dc12b70a40c74f30408cfe\" -d client=local -d tgt='*' -d fun='test.ping' -d arg\r\n```\r\nwill fail with:\r\n```\r\n File \\\"/usr/lib/python2.7/site-packages/salt/client/__init__.py\\\"\\\r\n  , line 290, in run_job\\n    raise SaltClientError(general_exception)\\nSaltClientError:\\\r\n  \\ unpack(b) received extra data.\\n\"\r\nstatus: 500\r\n```\r\nSo it might be a salt-api issue or me using the `api` incorrectly.\r\n\r\nExtra notes: \r\n* I am using `https` (but it has been working fine with `pepper` and `pam`)\r\n* salt-master version is 2015.5.5-1.el7 (centos 7)\r\n\r\nI am not sure what to try next. Thanks for your help."},"comment":{"url":"https://api.github.com/repos/saltstack/pepper/issues/comments/157495136","html_url":"https://github.com/saltstack/pepper/issues/63#issuecomment-157495136","issue_url":"https://api.github.com/repos/saltstack/pepper/issues/63","id":157495136,"user":{"login":"PierreR","id":93115,"avatar_url":"https://avatars.githubusercontent.com/u/93115?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreR","html_url":"https://github.com/PierreR","followers_url":"https://api.github.com/users/PierreR/followers","following_url":"https://api.github.com/users/PierreR/following{/other_user}","gists_url":"https://api.github.com/users/PierreR/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreR/subscriptions","organizations_url":"https://api.github.com/users/PierreR/orgs","repos_url":"https://api.github.com/users/PierreR/repos","events_url":"https://api.github.com/users/PierreR/events{/privacy}","received_events_url":"https://api.github.com/users/PierreR/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T20:20:08Z","updated_at":"2015-11-17T20:20:08Z","body":"I have done  point `1` but without much success. \r\n\r\nBut I should note that when I login (`salt-api`) there is already an error even if I do get a token that seems to work fine:\r\n```\r\ncurl -sS -i -k https://localhost:8000/login -H 'Accept: application/x-yaml' -d username='name' -d password='pass' -d eauth='ldap'\r\nHTTP/1.1 500 Internal Server Error\r\nContent-Length: 583\r\nAccess-Control-Expose-Headers: GET, POST\r\nVary: Accept-Encoding\r\nServer: CherryPy/3.2.2\r\nAllow: GET, HEAD, POST\r\nAccess-Control-Allow-Credentials: true\r\nDate: Tue, 17 Nov 2015 19:57:58 GMT\r\nAccess-Control-Allow-Origin: *\r\nX-Auth-Token: f34e1c1f6916aed84a5097ffcfca22d60ba96f68\r\nContent-Type: application/json\r\nSet-Cookie: session_id=f34e1c1f6916aed84a5097ffcfca22d60ba96f68; expires=Wed, 18 Nov 2015 05:57:58 GMT; Path=/\r\n\r\n{\"status\": 500, \"return\": \"Traceback (most recent call last):\\n  File \\\"/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py\\\", line 435, in hypermedia_handler\\n    ret = cherrypy.serving.request._hypermedia_inner_handler(*args, **kwargs)\\n  File \\\"/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py\\\", line 34, in __call__\\n    return self.callable(*self.args, **self.kwargs)\\n  File \\\"/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py\\\", line 1440, in POST\\n    user_groups = set(token['groups'])\\nTypeError: 'NoneType' object is not iterable\\n\"}\r\n```\r\n\r\nFor `2`, I have to admit I am actually using `pepper` with this [PR](https://github.com/saltstack/pepper/pull/59) as I need `https` without cert verification. Unfortunately and I guess this is as a consequence `H` does not make any change ... So I guess I would need to revert to http if I want to test it with `-H`.\r\n\r\n"}}