c# - ASP核心版本3中的Facebook登录异常
问题描述
我在 asp core 3 应用程序中设置了 Facebook 登录。当我点击 Facebook 登录按钮时,该网站重定向到 Facebook 登录页面,但是当它重定向回来时,我得到了这个异常页面:
找不到方法:'System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse(System.String, System.Text.Json.JsonReaderOptions)'
这是代码:
- 在启动时添加服务
services.AddAuthentication().AddFacebook(facebookOptions =>
{
facebookOptions.AppId = Configuration["Authentication:Facebook:AppId"];
facebookOptions.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
});
- 在用户密码中添加详细信息:
{
"Authentication:Facebook:AppId": "000000000000",
"Authentication:Facebook:AppSecret": "0000ada00000asasd00"
}
常规的身份验证过程工作得很好。只有当我尝试使用 Facebook 登录时,才会收到此错误。
另外,我读到 .NET Core 3.0 中的 JSON 支持还没有完成,所以我尝试使用 NewtonsoftJson 包,但问题没有解决。
解决方案
推荐阅读
- lua - 位置给定为字符串的 Lua 表访问
- python - 组合组合时的Python记录频率
- html5-canvas - HTML画布如何在背面设置图像,以便我可以在其上绘制
- html - 仅在没有类的 CSS 中的 Div 位置
- javascript - 在javascript函数中调用角度方法
- c - C. 使用的内存多于 malloc 中分配的内存 - 我可以返回某事,结束程序而不是让它崩溃吗?
- javascript - iframe 的 src 属性可以执行 POST 请求吗?
- python - 玩家没有同时移动
- php - 默认值为0的mysql-workbench列行不是NULL?
- php - 在 PHP 中从外部网页中提取数据的问题