gpt4 book ai didi

c# - 将 DocumentDB 与表单例份验证和角色结合使用

转载 作者:行者123 更新时间:2023-11-30 21:53:36 25 4
gpt4 key购买 nike

我正在尝试将来自外部身份验证服务的用户数据存储在 DocumentDB 中。成功登录 Google 后,我收到此错误:“无法找到请求的 .Net Framework Data Provider。它可能未安装。”我做错了什么?

这是源代码错误:

// Sign in the user with this external login provider if the user already has a login
var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
switch (result)
{

部分堆栈跟踪:

[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.]
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +948663
System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup) +84

[ArgumentException: The ADO.NET provider with invariant name 'Microsoft.Azure.Documents.Client' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.]

以下是我的 web.config 的一些片段:

<connectionStrings>
<add name="DefaultConnection" connectionString="AccountEndpoint=[blah]" providerName="Microsoft.Azure.Documents.Client"/>

<system.web>
<authentication mode="None" />

使用我的存储库对其他数据进行 CRUD 时,DocumentDB 工作正常。

最佳答案

DocumentDB 没有现成的成员资格/角色/等 asp.net 提供程序。您需要为其创建自己的自定义提供程序。

关于c# - 将 DocumentDB 与表单例份验证和角色结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33804574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com