【问题标题】:How can I authenticate a user in RavenDB如何在 RavenDB 中对用户进行身份验证
【发布时间】:2012-05-06 03:06:51
【问题描述】:

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

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

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

【问题讨论】:

    标签: authentication ravendb document-database


    【解决方案1】:

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

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

    【讨论】:

    • 非常感谢丹尼尔,我采用了相同的方法,但出现异常“远程服务器返回错误:(401)未经授权。”我该如何解决这个错误。请帮助
    猜你喜欢
    • 1970-01-01
    • 2013-03-11
    • 2021-11-30
    • 1970-01-01
    • 2021-06-11
    • 2021-07-20
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    相关资源
    最近更新 更多