呼叫者未通过服务进行身份验证-在站点中使用主机名并在本地呼叫时 [英] the caller was not authenticated by the service -- when using host name in site and call locally

查看:71
本文介绍了呼叫者未通过服务进行身份验证-在站点中使用主机名并在本地呼叫时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在1个生产服务器上,我有一个WCF服务,格式为:

On 1 production server I have a WCF service in the format of:

http://[host name]/[OneService.svc]

.

当客户端应用程序从同一服务器调用该应用程序时,它将引发以下错误:服务未对调用方进行身份验证……由于身份验证失败,无法满足对安全令牌的请求".

When the client app calls it FROM THE SAME SERVER, it throws error of: "The caller was not authenticated by the service...... The request for security token could not be satisfied because authentication failed".

Internet上有很多类似的主题.但是,它们似乎都与我的情况不同.我的是:

There are a lot of similar topics on Internet. However they all seems not same as my situation. My one is:

1,如果客户端应用在同一域内的另一台服务器上运行,或者在不同域内的另一台服务器上运行(但是这两个域彼此信任),则它可以正常工作;

1, If client app runs on ANOTHER server within the same domain, or runs on another server within different domain (but these 2 domains are trusted by each other), it works;

2,如果客户端应用程序在承载WCF服务的SAME服务器上运行,则会引发上述错误.

2, If client app runs on the SAME server which hosts the WCF service, it throws the error above.

3,但是,如果我将服务URL更改为

3, HOWEVER, if I change the service URL to

http://localhost/[OneService.svc]

,然后(2)起作用!

从我在1/2/3中观察到的情况来看,我猜测它可能不是代码或配置问题? (可以将服务配置为使用http或https.)

From what I observed in 1/2/3, I am guessing it may not the code or config issue? (Service can be configured to use either http or https.)

任何建议都值得赞赏!

推荐答案

这不是完美的解决方案,但确实对我有用.

This is not perfect solution but it does work for me.

我已经进行了注册表编辑(请您自担风险).

I have done regedit ( Please do this at your risk).

您必须在BackConnectionHostNames项中为您的域创建条目.

You have to create entry for your domain in BackConnectionHostNames key.

http://blog.blksthl.com/2013/05/07/a-quick-guide-to-configuring-the-loopback-check/

如果此方法无效,请给出确切的身份验证错误.

Also please give exact authentication error you get if this not work.

这篇关于呼叫者未通过服务进行身份验证-在站点中使用主机名并在本地呼叫时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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