Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for DIGEST-MD5/PLAIN mechanism? #5

Open
pchanne opened this issue Jun 14, 2016 · 5 comments
Open

Support for DIGEST-MD5/PLAIN mechanism? #5

pchanne opened this issue Jun 14, 2016 · 5 comments

Comments

@pchanne
Copy link

pchanne commented Jun 14, 2016

I am planning to use this for zookeeper sasl authentication with DIGEST-MD5 mechanism. I am running the client on Debian GNU/Linux 8 (jessie).

This is the sample code I am trying to run:

import sasl

saslc = sasl.Client(host='x.x.x.x:port', username='user', password='pass')
saslc.init()
print saslc.start('DIGEST-MD5')
print saslc.getError()

Output:

(False, '', '')
Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found

I get the same error with PLAIN mechanism.

I have the following libraries installed.

ii  libsasl2-2:amd64                   2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - authentication abstraction library
ii  libsasl2-dev                       2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - development files for authentication abstraction library
ii  libsasl2-modules:amd64             2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules
ii  libsasl2-modules-db:amd64          2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules (DB)
ii  libsasl2-modules-gssapi-mit:amd64  2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules (GSSAPI)
ii  libsasl2-modules-ldap:amd64        2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules (LDAP)
ii  libsasl2-modules-otp:amd64         2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules (OTP)
ii  libsasl2-modules-sql:amd64         2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - pluggable authentication modules (SQL)
ii  sasl2-bin                          2.1.26.dfsg1-13+deb8u1     amd64        Cyrus SASL - administration programs for SASL users database

Does the library support DIGEST-MD5 mechanism at all? Are there any other pre-requisites apart from above?

@wesm
Copy link
Contributor

wesm commented Jun 14, 2016

According to https://packages.debian.org/jessie/libsasl2-2, DIGEST-MD5 should be included.

I believe you are missing the service name. Can you add

saslc.setAttr('service', $KERBEROS_SERVICE_NAME)

with the appropriate substitute for your kerberos service name, and let me know what happens?

@wesm
Copy link
Contributor

wesm commented Jun 14, 2016

Oh, actually -- I think parameters you are passing to sasl.Client are being ignored. Please try instead using setAttr for each of the parameters: host, service, username, password

@pchanne
Copy link
Author

pchanne commented Jun 15, 2016

@wesm Thanks! That did it. Is there a plan to add a documentation around the usage?

@wesm
Copy link
Contributor

wesm commented Jun 15, 2016

Not a "plan" per se, but it'd be great to start a markdown doc showing example usage for different authentication mechanisms. Happy to accept patches.

@dfeinzeig
Copy link

@wesm Hi, total SASL newb question, but how can I get started with this to auth using digest-md5? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants