다음을 통해 공유


WSTrustServiceHost 클래스

This class extends the ServiceHost class implemented by Windows Communication Foundation (WCF) service model programming model. It is a service host for registering Security Token Services (STSes) and let you expose an STS for use by client applications when you are not using Internet Information Services (IIS). The ServiceHost will have multiple endpoints registered based on the number of listeners registered in the configuration.

네임스페이스: Microsoft.IdentityModel.Protocols.WSTrust
어셈블리: Microsoft.IdentityModel(microsoft.identitymodel.dll에 있음)

사용법

    Dim instance As WSTrustServiceHost

구문

‘선언
Public Class WSTrustServiceHost
    Inherits ServiceHost
public class WSTrustServiceHost : ServiceHost
public ref class WSTrustServiceHost : public ServiceHost
public class WSTrustServiceHost extends ServiceHost
public class WSTrustServiceHost extends ServiceHost

public class MySecurityTokenServiceConfiguration : SecurityTokenServiceConfiguration
    {
        public MySecurityTokenServiceConfiguration ()
            : base(”HelloWorldSTS”)
        {
            SecurityTokenService = typeof(MySecurityTokenService);
        }
    }
// Following code snippet uses WSTrustServiceHost to expose STS for use by 
// client applications
{   
    MySecurityTokenServiceConfiguration config = new MySecurityTokenServiceConfiguration();

    // Add the STS endoint information
    config.TrustEndpoints.Add( new ServiceHostEndpointConfiguration( "https://localhost:6000/SimpleActiveSTS", new WSHttpBinding(), typeof( IWSTrustFeb2005SyncContract ) ) );

    // Create the WS-Trust service host with our STS configuration
    using ( WSTrustServiceHost host = new WSTrustServiceHost( config, new Uri( "https://localhost:6000/SimpleActiveSTS" ) ) )
    {
        host.Open();
        Console.WriteLine( "SimpleActiveSTS started, press ENTER to stop ..." );
        Console.ReadLine();

설명

The WSTrustServiceHost class is the WIF(Windows® Identity Foundation) implementation of a Windows Communication Foundation ServiceHost that is intended to be used to integrate a WCF hosting environment with a Security Token Service (STS) built using WIF. The WSTrustServiceHost is a fully functioning ServiceHost which offers both integration with WCF configuration as well as WIF specific features that are configured by modifying the SecurityTokenServiceConfiguration, which is a class provided by WIF.

By default, the WSTrustServiceHost performs the following:

  1. It adds WS-Trust endpoints to the ServiceHost based on SecurityTokenServiceConfiguration.TrustEndpoints.

  2. It enables metadata over the base addresses if SecurityTokenServiceConfiguration.DisableWsdl is set to false.

  3. Thirdly, it configures the service certificate on the ServiceHost service credentials if a WIF configuration section specifies a service certificate. Note that this will override the equivalent service certificate settings in WCF configuration.

  4. Fourthly, it integrates WIF token handlers into the security processing pipeline by calling ExtensibleSecurityCredentials.ConfigureServiceHost() on itself.

The WSTrustServiceHost class may be overridden to customize this behavior.

상속 계층 구조

System.Object
   System.ServiceModel.Channels.CommunicationObject
     System.ServiceModel.ServiceHostBase
       System.ServiceModel.ServiceHost
        Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost

스레드 안전성

이 유형의 공용 정적(Visual Basic에서는 Shared) 멤버는 모두 스레드로부터 안전합니다.인스턴스 멤버는 스레드로부터 안전하지 않을 수 있습니다.

플랫폼

개발 플랫폼

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

Change History

참고 항목

참조

WSTrustServiceHost 멤버
Microsoft.IdentityModel.Protocols.WSTrust 네임스페이스