gpt4 book ai didi

Azure 故障排除 HTTP 500 : Validate user in memberhsip provider is not called

转载 作者:太空宇宙 更新时间:2023-11-03 14:28:09 25 4
gpt4 key购买 nike

当我尝试向 WCF 服务发送请求时,Azure 日志出现以下错误

在工作情况下,将调用 membershipprovider 的验证用户,然后调用 AfterReceiveRequest,最后调用 web 服务。

但在非工作情况下,不会调用 validateuser。它直接进入 AfterReceiveRequest 然后 webservice 抛出一个它无法理解 header 的异常。

Azure 应用程序网关将请求路由到 VM。它以某种方式看起来标题或成员(member)提供者未被识别。 SSL 在网关级别进行管理。

<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">

<serviceMetadata httpGetEnabled ="true" httpsGetEnabled ="true" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="IDServices.CustomMembershipProvider,IDServices"/>
</serviceCredentials>
<useRequestHeadersForMetadataAddress />

</behavior>

<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="endbehavior1">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
</behaviors>


{ "timeStamp": "2019-03-11T16:18:29+00:00",
"resourceId": "/SUBSCRIPTIONS/245CA15E-8C11-4F4C-B6D7-9F3E8EC5943F/RESOURCEGROUPS/JXCHANGERG/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/JHAAPPGW",
"operationName": "ApplicationGatewayAccess", "category": "ApplicationGatewayAccessLog", "properties":
{"instanceId":"appgw_0","clientIP":"009.04.06.009","clientPort":"65374","httpMethod":"POST","requestUri":"/PImage.svc","requestQuery":"",
"userAgent":"Apache-HttpClient/4.1.1 (java 1.5)","httpStatus":"500","httpVersion":"HTTP/1.1","receivedBytes":"2638","sentBytes":"917","timeTaken":"0.018","sslEnabled":"on",
"sslCipher":"ECDHE-RSA-AES256-GCM-SHA384","sslProtocol":"TLSv1.2","serverRouted":"40.124.51.221:80","serverStatus":"500","serverResponseLatency":"0.016","host":"jt.inaresecure.com"},
"time": "2019-03-11T16:18:29.0000000Z"}

任何人都可以帮助我解决可能的问题。请求在服务器上失败了吗?我得到的只是安全 header 错误。该代码适用于除此 Azure 上的 VM 之外的所有其他机器和服务器。该请求使用应用程序网关路由到在 SSL 上托管 WCF 服务的 VM

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:MustUnderstand</faultcode>
<faultstring xml:lang="en-US">The header 'Security' from the namespace 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' was not understood by the recipient of this message, causing the message to not be processed. This error typically indicates that the sender of this message has enabled a communication protocol that the receiver cannot process. Please ensure that the configuration of the client's binding is consistent with the service's binding.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>

这是同一调用的 IIS 日志,可能由于我的请求而在不同的时间

请求设置为使用 SSL。为什么它在日志中有 80?它不是在做 SSL 请求吗?这是来自 SOAP UI 的请求

2019-03-11 17:27:44 10.0.0.4 POST /PCServices/2019/MySerivce.svc - 80 - 20.45.4.43 Apache-HttpClient/4.1.1+(java+1.5) - 500 0 0 1468

最佳答案

可能是HTTP请求失败的原因。如果您从 HTTPS 调用和调用 HTTPS,则身份验证会自动完成。但您必须在 HTTP 请求中强制进行身份验证。

if (HttpContext.Current.Request.Url.Scheme.ToUpper().Equals("HTTP"))
{
CustomMembershipProvider auth = new CustomMembershipProvider();
auth.Validate(Username,Pswd);
}

关于Azure 故障排除 HTTP 500 : Validate user in memberhsip provider is not called,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55106646/

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