Ben Foster
Ben Foster

Reputation: 34800

Unable to authenticate to RavenDB server on local network

I am attempting to connect to RavenDB on Server2 from Server1.

On Server2 I have created a new user "RavenDBUser" and granted them read/write access to the Database directory within the RavenDB installation.

I am running RavenDB as the windows service on port 8080.

On Server1 I have set the connection string for my application to:

Url=http://server2:8080;Database=MyDatabase;Domain=server2;user=RavenDBUser;password=mypassword;

When I run my application, I get a 403, forbidden error.

However, I am able to connect to the RavenDB Studio from Server1 and view "MyDatabase" after authenticating as "RavenDBUser".

The error details can be seen below:

[WebException: The remote server returned an error: (403) Forbidden.] System.Net.HttpWebRequest.GetResponse() +8522396
Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func1 getResponse) +805
Raven.Client.Connection.HttpJsonRequest.ReadResponseJson() +587
Raven.Client.Connection.ServerClient.DirectPutIndex(String name, String operationUrl, Boolean overwrite, IndexDefinition definition) +774 Raven.Client.Connection.<>c__DisplayClass50.<PutIndex>b__4f(String operationUrl) +36
Raven.Client.Connection.ReplicationInformer.TryOperation(Func
2 operation, String operationUrl, Boolean avoidThrowing, T& result) +194 Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication(String method, String primaryUrl, Int32 currentRequest, Int32 currentReadStripingBase, Func2 operation) +526
Raven.Client.Connection.ServerClient.ExecuteWithReplication(String method, Func
2 operation) +138
Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) +86
Raven.Client.Indexes.IndexCreation.CreateIndexes(ExportProvider catalogToGetnIndexingTasksFrom, IDatabaseCommands databaseCommands, DocumentConvention conventions) +108
MyApp.CMSRegistry.InitializeStore() +380 MyApp.CMSRegistry..ctor() +66

Upvotes: 2

Views: 1408

Answers (1)

Ben Foster
Ben Foster

Reputation: 34800

It seems the missing piece was that you have to explicitly enable the windows user/group in the RavenDB system database configuration.

The not so easy to find docs for doing this can be found at http://ravendb.net/docs/studio/multi-database about 3/4 down the page.

Upvotes: 1

Related Questions