ClientCredentials 클래스

정의

사용자가 클라이언트 및 서비스 자격 증명을 구성할 수 있을 뿐만 아니라 클라이언트측에서 통신에 사용할 서비스 자격 증명 인증 설정을 구성할 수 있도록 합니다.

public ref class ClientCredentials : System::ServiceModel::Description::IEndpointBehavior
public ref class ClientCredentials : System::ServiceModel::Security::SecurityCredentialsManager, System::ServiceModel::Description::IEndpointBehavior
public class ClientCredentials : System.ServiceModel.Description.IEndpointBehavior
public class ClientCredentials : System.ServiceModel.Security.SecurityCredentialsManager, System.ServiceModel.Description.IEndpointBehavior
type ClientCredentials = class
    interface IEndpointBehavior
type ClientCredentials = class
    inherit SecurityCredentialsManager
    interface IEndpointBehavior
Public Class ClientCredentials
Implements IEndpointBehavior
Public Class ClientCredentials
Inherits SecurityCredentialsManager
Implements IEndpointBehavior
상속
ClientCredentials
상속
파생
구현

예제

다음 코드 샘플에서는 이 클래스를 재정의하고 사용자 지정 보안 토큰 관리자를 포함하는 사용자 지정 클라이언트 자격 증명을 구현하는 방법을 보여 줍니다.

중요

사용자 지정 보안 토큰 관리자를 CreateSecurityTokenManager 만들기 위해 메서드가 재정의된다는 점에 유의해야 합니다. 에서 파생된 ClientCredentialsSecurityTokenManager보안 토큰 관리자입니다. 는 실제 보안 토큰을 만들려면 파생된 SecurityTokenProvider사용자 지정 보안 토큰 공급자를 반환해야 합니다. 보안 토큰을 만들 때 이 방식을 따르지 않으면 애플리케이션이 특히 권한 상승과 같은 보안 공격을 받을 위험이 있습니다. 이 코딩 패턴은 채널 팩터리를 캐시할 때 올바른 자격 증명이 사용되도록 합니다.

public class MyClientCredentials : ClientCredentials
{
    string creditCardNumber;

    public MyClientCredentials()
    {
        // Perform client credentials initialization.
    }

    protected MyClientCredentials(MyClientCredentials other)
        : base(other)
    {
        // Clone fields defined in this class.
        this.creditCardNumber = other.creditCardNumber;
    }

    public string CreditCardNumber
    {
        get
        {
            return this.creditCardNumber;
        }
        set
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            this.creditCardNumber = value;
        }
    }

    public override SecurityTokenManager CreateSecurityTokenManager()
    {
        // Return your implementation of the SecurityTokenManager.
        return new MyClientCredentialsSecurityTokenManager(this);
    }

    protected override ClientCredentials CloneCore()
    {
        // Implement the cloning functionality.
        return new MyClientCredentials(this);
    }
}
Public Class MyClientCredentials
    Inherits ClientCredentials
    Private creditCardNumberValue As String

    Public Sub New() 
    
    End Sub
    
    ' Perform client credentials initialization.    
    Protected Sub New(ByVal other As MyClientCredentials) 
        MyBase.New(other)
        ' Clone fields defined in this class.
        Me.creditCardNumberValue = other.creditCardNumberValue
    
    End Sub

    Public Property CreditCardNumber() As String 
        Get
            Return Me.creditCardNumberValue
        End Get
        Set
            If value Is Nothing Then
                Throw New ArgumentNullException("value")
            End If
            Me.creditCardNumberValue = value
        End Set
    End Property

    Public Overrides Function CreateSecurityTokenManager() As SecurityTokenManager 
        ' Return your implementation of the SecurityTokenManager.
        Return New MyClientCredentialsSecurityTokenManager(Me)
    
    End Function
    
    Protected Overrides Function CloneCore() As ClientCredentials 
        ' Implement the cloning functionality.
        Return New MyClientCredentials(Me)
    
    End Function
End Class

설명

ClientCredentialsClientCredentials 클래스의 ClientBase<TChannel> 속성을 통해 액세스됩니다.

컬렉션에 ClientCredentials 개체가 추가됩니다 Behaviors . 이 ClientCredentials 속성은 해당 컬렉션의 항목에 대한 외관 (잘 알려진 디자인 패턴)입니다. 이 클래스의 많은 속성은 주로 속성으로 구성된 개체를 반환합니다. 이러한 개체는 구성에 사용할 수 있습니다. 개체가 있으면 get 해당 멤버를 set 호출하여 속성에 사용할 수 있습니다.

생성자

ClientCredentials()

ClientCredentials 클래스의 새 인스턴스를 초기화합니다.

ClientCredentials(ClientCredentials)

이 생성자는 복사 생성자입니다.

속성

ClientCertificate

클라이언트가 서비스로부터 인증을 얻기 위해 사용하는 X.509 인증서를 제공하는 데 사용할 수 있는 개체를 가져옵니다.

HttpDigest

현재 HTTP 다이제스트 자격 증명을 가져옵니다.

IssuedToken

이 속성을 사용하여 로컬 보안 토큰 서비스에 연결할 때 사용할 엔드포인트 주소 및 바인딩을 지정합니다. 발급된 토큰을 사용하여 서비스로부터 인증을 얻어야 하지만 발급된 토큰을 가져오는 방법과 위치가, 클라이언트에서 바인딩으로 표시된 서비스 정책에 명시적으로 지정되어 있지 않은 경우 이 정보가 사용됩니다.

Peer

피어 노드가 메시에서 다른 노드로부터 인증을 얻는 데 사용하는 자격 증명 및 피어 노드가 다른 피어 노드를 인증하는 데 사용하는 인증 설정을 제어합니다.

SecurityTokenHandlerCollectionManager

클라이언트 자격 증명의 보안 토큰 처리기를 가져오거나 설정합니다.

ServiceCertificate

서비스의 X.509 인증서를 지정하는 데 사용되는 개체를 가져옵니다.

SupportInteractive

필요한 경우 사용자에게 자격 증명을 묻는 대화형 프롬프트를 표시할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다. 예를 들어, 중간 계층 시나리오에서는 이 값을 false로 설정하는 것이 좋습니다.

UseIdentityConfiguration

클라이언트 자격 증명에서 ID 구성을 사용하는지 여부를 가져오거나 설정합니다.

UserName

클라이언트가 서비스로부터 인증을 얻을 때 사용하는 사용자 이름과 암호를 설정하는 데 사용할 수 있는 자격 증명 개체를 가져옵니다.

Windows

클라이언트가 서비스로부터 인증을 얻는 데 사용하는 Windows 자격 증명을 제어하는 개체를 가져옵니다.

메서드

ApplyClientBehavior(ServiceEndpoint, ClientRuntime)

지정된 클라이언트 동작을 엔드포인트에 적용합니다.

Clone()

ClientCredentials 인스턴스의 새 복사본을 만듭니다.

CloneCore()

ClientCredentials 인스턴스의 새 복사본을 만듭니다.

CreateSecurityTokenManager()

이 인스턴스에 대한 보안 토큰 관리자를 만듭니다. 이 메서드는 명시적으로 호출되는 경우가 드물며, 주로 확장성 시나리오에 사용되어 시스템 자체에서 호출됩니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetInfoCardSecurityToken(Boolean, CardSpacePolicyElement[], SecurityTokenSerializer)

CardSpace 시스템 및 지정된 정책 체인 및 토큰 serializer를 사용하여 보안 토큰을 생성하고 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IEndpointBehavior.AddBindingParameters(ServiceEndpoint, BindingParameterCollection)

이 클래스의 이 인스턴스를 바인딩 매개 변수 컬렉션에 추가합니다.

IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint, EndpointDispatcher)

엔드포인트에 대해 서비스의 수정이나 확장을 구현합니다.

IEndpointBehavior.Validate(ServiceEndpoint)

나중에 사용하기 위해 예약되어 있습니다.

적용 대상