2012-03-08 14 views
11

に接続することができませんコアサービスに接続しようとしますが、私は次のエラーを取得する:Tridionの2011コアサービス:SSO環境

The HTTP request was forbidden with client authentication scheme 'Anonymous'

Tridionの環境は、SiteMinderのからSSOが設定されています。ここで

は私のコードです:

public static ICoreService2010 GetTridionClient() 
{ 
    var binding = new BasicHttpBinding() 
    { 
     Name = "BasicHttpBinding_TridionCoreService", 
     CloseTimeout = new TimeSpan(0, 1, 0), 
     OpenTimeout = new TimeSpan(0, 1, 0), 
     ReceiveTimeout = new TimeSpan(0, 10, 0), 
     SendTimeout = new TimeSpan(0, 1, 0), 
     AllowCookies = false, 
     BypassProxyOnLocal = false, 
     HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, 
     MaxBufferSize = 4194304, // 4MB 
     MaxBufferPoolSize = 4194304, 
     MaxReceivedMessageSize = 4194304, 
     MessageEncoding = WSMessageEncoding.Text, 
     TextEncoding = System.Text.Encoding.UTF8, 
     TransferMode = TransferMode.Buffered, 
     UseDefaultWebProxy = true, 
     ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas() 
     { 
      MaxDepth = 32, 
      MaxStringContentLength = 4194304, // 4MB 
      MaxArrayLength = 4194304, 
      MaxBytesPerRead = 4194304, 
      MaxNameTableCharCount = 16384 
     }, 
     Security = new BasicHttpSecurity() 
     { 
      Mode = BasicHttpSecurityMode.TransportCredentialOnly, 
      Transport = new HttpTransportSecurity() 
      { 
       ClientCredentialType = HttpClientCredentialType.None, 
      }, 
      Message = new BasicHttpMessageSecurity() 
      { 
       ClientCredentialType = BasicHttpMessageCredentialType.UserName 
      } 
     } 
    }; 

    string hostname = ConfigurationManager.AppSettings["TridionUrl"]; 
    string username = ConfigurationManager.AppSettings["TridionUsername"]; 

    hostname = string.Format("{0}{1}{2}", 
           hostname.StartsWith("http") ? "" : "http://", 
           hostname, 
           hostname.EndsWith("/") ? "" : "/"); 
    var endpoint = new EndpointAddress(hostname + 
           "/webservices/CoreService.svc/basicHttp_2010"); 
    var factory = new ChannelFactory<ICoreService2010>(binding, endpoint); 
    factory.Credentials.UserName.UserName = username; 

    return factory.CreateChannel(); 
} 

誰には、Windows以外の認証タイプのコアサービスとの相互作用の経験を持っていますか?

UPDATE:

私は今のエラーを取得:

バインディングのために/webservices/web.configで使用されるべきである何clientCredentialType

The HTTP request was forbidden with client authentication scheme 'Basic'.

/webservies/web.configのSsoAgentHttpModuleのコメントを外すと、Webサービスで500のエラーが発生するため、SDLはこれをコメントアウトしておくように指示しました。

このモジュールは、CoreServiceが認証スキーム「Basic」で認証するために必要ですか?

+0

/webservices/web.configのSsoAgentHttpModuleのコメントを解除する必要はありません。これは、ルート設定でコメントを外したので、ウェブサイト全体に対して適用されます。適切な(SSO URL)に接続していますか? –

答えて

6

はあなたのコードと2つの問題があります:あなたは、サーバー上で匿名にauthentictionを設定し、同じクライアント上で設定する必要があることを前提としている

  1. が、それはそうではないのです。また、匿名認証をオンにするとすぐに起動するサーバー上のLDAP SSOモジュールも有効にしています。あなたがパスワードをユーザ名を設定しますが、していない

    Security = new BasicHttpSecurity() 
        { 
         Mode = BasicHttpSecurityMode.TransportCredentialOnly, 
         Transport = new HttpTransportSecurity() 
         { 
          ClientCredentialType = HttpClientCredentialType.Basic, 
         } 
        } 
    
  2. ので、::あなたのクライアントのセキュリティコードは次のようにする必要がありますので、クライアント側では、それは、プレーンな基本認証のようになります。

    factory.Credentials.UserName.UserName = username; 
    factory.Credentials.UserName.Password = password; 
    

また、SSOユーザーのようにユーザーを設定するときに、ユーザー名修飾子(既定ではSSO)を指定する必要があることに注意してください。

これは、あなたの質問を最近の例外で更新してください。

+3

助けてくれてありがとう、私は今得た例外で質問を更新した。 –

+0

こんにちはuser978511、分があるときはTridion StackExchangeの提案をご覧ください。 http://area51.stackexchange.com/proposals/38335/tridion私たちはコミットメントスコアには時には訪問が必要であると信じています。したがって、あなたは「200人以上のユーザー」にあなたを含めません。ありがとう! –

関連する問題