如何在RavenDB中验证用户身份

时间:2012-04-25 12:23:32

标签: authentication ravendb document-database

什么是服务器模式下ravendb的身份验证机制。 Authentication捆绑包包含用于创建用户的AuthenticationUser类和用于验证用户的AuthenticateClient类。 AuthenticateClient类有一个函数

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

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

1 个答案:

答案 0 :(得分:0)

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

RavenDB默认使用Windows身份验证。如果您想使用OAuth,则可以使用Authentication Bundle。请看一下如何使用该捆绑包:http://ravendb.net/docs/server/bundles/authentication