AD B2C错误:发送网络api请求时发生错误 [英] AD B2C Error: An error occurred while sending the web api request

查看:173
本文介绍了AD B2C错误:发送网络api请求时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经实现了以下示例,将示例Web应用程序和Web API托管在两个Azure Web应用程序上

I have implemented the following example hosting the web app and web api on two Azure Web Apps

https://github.com/Azure-Samples/active-directory-b2c-dotnet-webapp-and-webapi

https://github.com/Azure-Samples/active-directory-b2c-dotnet-webapp-and-webapi

在用户界面中单击待办事项列表时,出现以下错误.
内部例外1:
HttpRequestException:发送请求时发生错误.
内部例外2:
WebException:基础连接已关闭:发送时发生意外错误.
内部例外3:
IOException:无法从传输连接中读取数据:现有连接被远程主机强行关闭.
内部异常4:
SocketException:现有连接被远程主机强行关闭

I get the following error when from the UI I click on the to-do list.
Inner Exception 1:
HttpRequestException: An error occurred while sending the request.
Inner Exception 2:
WebException: The underlying connection was closed: An unexpected error occurred on a send.
Inner Exception 3:
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Inner Exception 4:
SocketException: An existing connection was forcibly closed by the remote host


我已经尝试过与邮递员一起使用该请求,并且该请求有效. 请求详细信息:
{方法:GET,RequestUri:" {
授权:Bearer eyJ0eXAiOiJK .......


I have tried the request with Postman and it works.
Request details:
{Method: GET, RequestUri: 'https://taskservice-..../api/tasks/', Version: 1.1, Content: <null>, Headers:
{
Authorization: Bearer eyJ0eXAiOiJK.......

Any idea?
Thanks in advance

推荐答案

您是否对TaskService Web Config进行了更改?您需要使用B2C配置对其进行更新.我建议您通过阅读自述文件来再次检查存储库,以确保一切设置正确.

Did you make changes to your TaskService Web Config? You need to update it with your B2C Configuration. I suggest you to check your repo once again by going through the readme to make sure everything is set correctly.


这篇关于AD B2C错误:发送网络api请求时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆