SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

Unable to connect using Plain Credentials (when using LDAP) #61

Closed merrickkw closed 8 years ago

merrickkw commented 8 years ago

Please add support for Plain Credentials, which is used for LDAP.

Currently the code at org.restheart.db.MongoDBClientSingleton:

                    credentials.add(MongoCredential.createCredential((String) mongoUser, (String) mongoAuthDb, ((String) mongoPwd).toCharArray()));

The above need to be replaced with the following

                    credentials.add(MongoCredential.createPlainCredential((String) mongoUser, (String) mongoAuthDb, ((String) mongoPwd).toCharArray()));

mongoAuthDb will need to configured at the restheart.yml (mongo-credentials - auth-db) as $external

mkjsix commented 8 years ago

Hi, we can insert this into our backlog, but if you need anything soon the best way would be to open a pull request (code and tests).

merrickkw commented 8 years ago

I hope next version will use and support

com.mongodb.MongoClientURI

This should solve any kind of authentication mechanism

ujibang commented 8 years ago

this sounds like a great idea!

I'll check it and eventually we can turn the mongo configuration option to use mongo URIs!

this way, we can also pass options to configure, for instance, the Write concern.

I created the improvement in our jira https://softinstigate.atlassian.net/browse/RH-119

ujibang commented 8 years ago

FYI mongo-uri is now used in configuration file!

Find it in the latest commit cae8e757635fc2f7dafa25e09134d4d194fbc74b

It will be officially released with RESTHeart 1.1

ujibang commented 8 years ago

@merrickkw release 1.1 is out with mongo uri support. more info at http://www.softinstigate.com/blog/2015/12/08/what-is-new-in-RESTHeart-1.1.0/

we also cited your suggestion, thanks

merrickkw commented 8 years ago

@ujibang Thanks for the updates!! will try to play around with it again...