Closed johnidm closed 9 years ago
Please have a look at MongoWireAuthenticate
from the mongoAuth.pas unit
Okay, thanks.
this works for me:
uses
mongoWire, mongoAuth;
var
db:TMongoWire;
begin
db.Open(Format('ds%.6d.mongolab.com',[MyMongoLabNr]),MyMongoLabNr);
MongoWireAuthenticate(db,'test1','user1','user1');
@stijnsanders for me not work, return error MongoWire.Get: not authorized for query on persons.names.$cmd
Look:
var
db:TMongoWire;
begin
db:= TMongoWire.Create('persons');
db.Open(Format('ds%.6d.mongolab.com',[45011]), 45011);
MongoWireAuthenticate(db,'names','user','user');
end;
db is persons
collection is names
user and password is user
lab is 45011
You're right, authentication has changed in version 2.6: http://docs.mongodb.org/manual/core/authentication/
Do you happen to know which one of these mongolab is using? https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst
Please see my recent commit: apparently the collection prefix to '$cmd' is no longer needed.
Okay, @stijnsanders.
I will see.
Thanks for help.
@stijnsanders worked.
Look www.johnidouglas.com.br/using-tmongowire-to-connect-database-in-mongolab-com/
Thanks for help.
Dear @stijnsanders, I want to connect in database registered in mongolab.com.
I tried
FMongoWire.Open('ds043971.mongolab.com', 43971);
, but return error'MongoWire.Query: not authorized for query on delphi.items'
After, I tried
FMongoWire.Open('mongodb://delphi:delphi@ds043971.mongolab.com:43971/delphi', 43971)
return error'The requested name is valid, but no data of the requested type was found'
Information of connection
dbuser is delphi dbpassword is delphi
I change db "mwx1" to "delphi" in MongoLab
It is possible to connect the MongoLab with TMongoWire?
Thanks.