Hi Alfonso, I have added the fix with https://github.com/apache/gora/pull/90 and also created a jira [1] for tracking as well.
I have added an additional property to specify authentication mechanism gora.mongodb.authentication.type and added all the supported authentication mechanisms [2] as well. [1] https://issues.apache.org/jira/browse/GORA-498 [2] http://mongodb.github.io/mongo-java-driver/3.4/driver/tutorials/authentication/ Thanks, Madhawa Madhawa On Sat, Dec 10, 2016 at 10:29 PM, Alfonso Nishikawa < [email protected]> wrote: > Hi, Shaharia. > > I don't know much about MongoDB, but taking a look at MongoStore [1] and > Mongo documentation [2] I suspect that there is not a way at this moment. > But, I read in .createCredential() documentation that it states at [3]: > > *"Creates a MongoCredential instance with an unspecified mechanism. The > client will negotiate the best mechanism based on the version of the server > that the client is authenticating to. If the server version is 3.0 or > higher, the driver will authenticate using the SCRAM-SHA-1 mechanism. > Otherwise, the driver will authenticate using the MONGODB_CR mechanism."* > > so it should be working. If it does not work, I don't know why :\ > > In the meantime, if you need SCRAM-SHA-1 and will not use MONGODB-CR, you > can try to modify the line at [1] to use .createScramSha1Credential > <http://api.mongodb.com/java/current/com/mongodb/MongoCredential.html#createScramSha1Credential-java.lang.String-java.lang.String-char:A-> > ()and 'mvn install' it. > > [1] - https://github.com/apache/gora/blob/master/gora-mongodb/ > src/main/java/org/apache/gora/mongodb/store/MongoStore.java#L156 > [2] - http://api.mongodb.com/java/current/com/mongodb/MongoCredential.html > [3] - http://api.mongodb.com/java/current/com/mongodb/ > MongoCredential.html#createCredential-java.lang. > String-java.lang.String-char:A- > > Or let's wait until someone with more knowledge answers :) > > Regards, > > Alfonso Nishikawa > > > 2016-12-10 12:55 GMT-01:00 Shaharia Azam <[email protected]>: > >> Hello All, >> MongoDB has 2 types of Authentication Mechanism. >> >> Is there any way to define authMechanism in Gora Mongodb? Currently it >> works well only for MONGODB-CR. So what about SCRAM-SHA-1? >> >> Thanks, >> Shaharia >> >> >

