Client API : Setting up Authentication and Authorization
Authentication and authorization is based on client X.509 certificates.
The Certificate
property allows you to pass a certificate which will be used by the RavenDB client to connect to a server.
Note
If your RavenDB instance is running on 'https', then your application has to use a client certificate in order to be able to access the server. You can find more information here.
Example
// load certificate
X509Certificate2 clientCertificate = new X509Certificate2("C:\\path_to_your_pfx_file\\cert.pfx");
using (IDocumentStore store = new DocumentStore()
{
Certificate = clientCertificate,
Database = "Northwind",
Urls = new[] {"https://my_secured_raven"}
}.Initialize())
{
// do your work here
}