AutoCompleteExtender - 身份验证失败(表单身份验证)
我在我的 aspx 页面上使用 AJAX 控制工具包中的 AutoCompleteExtender - 我将其连接到返回字符串数组的 WCF 服务,并且一切正常。
如果我更改服务定义以包含对调用者进行身份验证的要求,如下所示:
<OperationContract(), PrincipalPermission(SecurityAction.Demand, Authenticated:=True)> _
Public Function GetLookupValues(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
然后自动完成扩展程序将停止工作,并且我会在服务中收到身份验证错误。该服务设置为使用 ASPNetCompatibility 模式,我希望扩展程序能够传递我登录用户的身份验证凭据 - 有人知道如何实现此功能吗?
I'm using the AutoCompleteExtender from the AJAX control toolkit on my aspx page - I have it wired up to a WCF service that is returning a string array and everything works happily.
If I change my service definition to include a demand for the caller to be authenticated, like so:
<OperationContract(), PrincipalPermission(SecurityAction.Demand, Authenticated:=True)> _
Public Function GetLookupValues(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
Then the autocomplete extender stops working, and I get an authentication error in the service. The service is set up to use ASPNetCompatibility mode, and I was hoping that the extender would pass the authentication credentials for my logged in user - does anyone know how to make this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此处的示例提到了 AutoCompleteExtender 上的 ContextKey 属性。如果您在扩展器上设置此属性,行为会改变吗?
另外这篇 StackOverflow 帖子可能有一些答案。
The sample over here mentions a ContextKey property on the AutoCompleteExtender. Does the behaviour change if you set this property on the extender?
Also this StackOverflow post might have some answers.
以防万一有人发现这一点并且感到好奇,我最终切换回“旧”风格(asmx)网络服务,并且效果很好。
Just in case anybody finds this and is curious, I wound up switching back to an 'old' style (asmx) web service and that worked just fine.