2012-04-25 26 views
1

服务器模式下ravendb的验证机制是什么? Authentication包包含用于创建用户的AuthenticationUser类和用于验证用户的AuthenticateClient类。 AuthenticateClient类有一个功能我如何在RavenDB中验证用户

public bool Authenticate(DocumentDatabase currentStore, string username, string password, out AccessTokenBody.DatabaseAccess[] allowedDatabases) 

我不知道如何使用这个函数的方式。这个函数需要DocumentDatabase对象。我不知道如何实例化DocumentDatabase对象。有什么办法来实现身份验证?如果你知道的话,请告诉我更好的方法。提前致谢。

回答

0

Rajdeep,你不需要使用这个类,也不需要实例化DocumentDatabase类。这是RavenDB内部的东西。

RavenDB默认使用Windows身份验证。如果您想要使用OAuth,则这是Authentication Bundle的用途。请看看这里看看你怎么可以使用该捆绑:http://ravendb.net/docs/server/bundles/authentication

+0

非常感谢丹尼尔,我遵循相同的方法,但异常发生“远程服务器返回错误:(401)未经授权。” 我该如何解决此错误?请帮助 – 2012-04-26 05:37:03

+0

你做了什么?请张贴代码 – 2012-04-27 22:54:32