WCF 客户端错误:“未指定安全令牌颁发者的地址" [英] WCF Client error: "The address of the security token issuer is not specified"

查看:41
本文介绍了WCF 客户端错误:“未指定安全令牌颁发者的地址"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的 WCF 客户端收到以下错误.未指定安全令牌发行者的地址.必须在目标 'http://site.com/TLAPI.svc' 的绑定中指定明确的发行者地址,或者必须在凭据中配置本地发行者地址."

我正在尝试连接到 SharePoint 服务应用程序.我在下面添加了生成客户端类的服务引用.到目前为止,这是我的代码:

TipAndLeadAPIContractClient client = new TipAndLeadAPIContractClient(@"CustomBinding_ITipAndLeadAPIContract", @"http://site.com/TLAPI.svc");client.ChannelFactory.Credentials.SupportInteractive = false;client.ClientCredentials.UserName.UserName = "user";client.ClientCredentials.UserName.Password = "密码";client.ConvertToTLForm(@"C:\Clients\ServiceApplication\CAP\capsample1.xml", "tl_library", "http://site/");

这是我的客户端绑定配置:

 <security defaultAlgorithmSuite="默认" authenticationMode="IssuedToken"requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true"keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><issuedTokenParameters keyType="SymmetricKey" tokenType=""/><localClientSettings cacheCookies="true" detectReplays="true"replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="无限"replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60"/><localServiceSettings detectReplays="true"issuedCookieLifetime="10:00:00"maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"协商超时="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"reconnectTransportOnFailure="true" maxPendingSessions="128"maxCachedCookies="1000" timestampValidityDuration="00:05:00"/><secureConversationBootstrap/></安全><binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"maxSessionSize="2048"><readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"maxBytesPerRead="4096" maxNameTableCharCount="16384"/></binaryMessageEncoding><httpTransport manualAddressing="false" maxBufferPoolSize="524288"maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="匿名"bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="匿名"领域="" transferMode="缓冲" unsafeConnectionNtlmAuthentication="false"useDefaultWebProxy="true"/></binding>

这是我的服务应用程序绑定配置:

 <绑定名称="CalcServiceHttpBinding"><security authenticationMode="IssuedToken" allowInsecureTransport="true"/><binaryMessageEncoding><readerQuotas maxStringContentLength="1048576" maxArrayLength="2097152"/></binaryMessageEncoding><httpTransport maxReceivedMessageSize="2162688" authenticationScheme="Ntlm" useDefaultWebProxy="false"/></binding>

提前致谢.

解决方案

使用 IssuedToken 凭据类型设置绑定:

<块引用>

首先,我不确定为什么您的 tokenType 属性为空.这应该设置为将要协商的令牌类型,例如 SAML 令牌,它是 tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-以 token-profile-1.1#SAMLV1.1" 为例.

下一个节点有一个名为 允许您指定客户端应用于协商令牌的安全令牌服务器 (STS) 的地址.你得到的例外是告诉你这没有特别配置. 元素可能如下所示.

除了地址之外,您还需要指定应该与任何自定义配置一起使用的绑定类型,您可能需要能够与 STS 通信.

I am receiving the following error from my WCF Client. "The address of the security token issuer is not specified. An explicit issuer address must be specified in the binding for target 'http://site.com/TLAPI.svc' or the local issuer address must be configured in the credentials."

I am trying to connect to a SharePoint Service Application. I have added the service reference which generated the client class below. Here is my code thus far:

TipAndLeadAPIContractClient client = new TipAndLeadAPIContractClient(@"CustomBinding_ITipAndLeadAPIContract", @"http://site.com/TLAPI.svc");
client.ChannelFactory.Credentials.SupportInteractive = false;
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "password";
client.ConvertToTLForm(@"C:\Clients\ServiceApplication\CAP\capsample1.xml", "tl_library", "http://site/");

Here is my client side binding configuration:

 <binding name="CustomBinding_ITipAndLeadAPIContract">
                <security defaultAlgorithmSuite="Default" authenticationMode="IssuedToken"
                    requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true"
                    keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
                    messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
                    requireSignatureConfirmation="false">
                    <issuedTokenParameters keyType="SymmetricKey" tokenType="" />
                    <localClientSettings cacheCookies="true" detectReplays="true"
                        replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
                        replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
                        sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
                        timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
                    <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
                        maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
                        negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
                        sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
                        reconnectTransportOnFailure="true" maxPendingSessions="128"
                        maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
                    <secureConversationBootstrap />
                </security>
                <binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                    maxSessionSize="2048">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                </binaryMessageEncoding>
                <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
                    maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
                    bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
                    realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                    useDefaultWebProxy="true" />
            </binding>

And here is my Service Application binding configuration:

        <binding name="CalcServiceHttpBinding">

      <security authenticationMode="IssuedToken" allowInsecureTransport="true" />

      <binaryMessageEncoding>

        <readerQuotas maxStringContentLength="1048576" maxArrayLength="2097152" />
      </binaryMessageEncoding>
      <httpTransport maxReceivedMessageSize="2162688" authenticationScheme="Ntlm" useDefaultWebProxy="false" />
    </binding>

Thanks in advance.

解决方案

The binding is setup with an IssuedToken credential type:

<issuedTokenParameters keyType="SymmetricKey" tokenType="" /> 

First, I'm not sure why your tokenType attribute is blank. This should be set to the type of token that is going to be negotiated, such as a SAML token which would be tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" for example.

Next node has a child node called <issuer> which allows you to specify the address of an secure token server (STS) that the client should use to negotiate the token. The exception that you're getting is telling you that this specifically is not configured. An <issuer> element might look like this.

<issuer address="https://someserver/SomeSTS" binding="<some binding type>" bindingConfiguration="<some binding configuration for the STS>" />

In addition to the address you'll want to specify the binding type that should be used along with any custom configuration that you might need to be able to talk with the STS.

这篇关于WCF 客户端错误:“未指定安全令牌颁发者的地址"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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