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 <shaharia.a...@gmail.com>:

> 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
>
>

Reply via email to