ClientCredentials 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
사용자가 클라이언트 및 서비스 자격 증명 및 통신의 클라이언트 쪽에서 사용할 서비스 자격 증명 인증 설정을 구성할 수 있도록 합니다.
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
설명
클래스 ClientCredentials 의 속성을 통해 ClientCredentials 액세스됩니다 ClientBase<TChannel> .
ClientCredentials 개체가 컬렉션에 Behaviors 추가됩니다. 이 ClientCredentials 속성은 해당 컬렉션의 항목에 대한 Facade (잘 알려진 디자인 패턴)입니다. 이 클래스의 많은 속성은 주로 속성으로 구성된 개체를 반환합니다. 이러한 개체를 구성에 사용할 수 있습니다. 개체를 만든 후에 get 는 해당 멤버를 set 호출하여 속성에 사용할 수 있습니다.
생성자
| Name | Description |
|---|---|
| ClientCredentials() |
ClientCredentials 클래스의 새 인스턴스를 초기화합니다. |
| ClientCredentials(ClientCredentials) |
복사 생성자입니다. |
속성
| Name | Description |
|---|---|
| ClientCertificate |
클라이언트가 서비스에 인증하는 데 사용하는 X.509 인증서를 제공하는 데 사용할 수 있는 개체를 가져옵니다. |
| HttpDigest |
현재 HTTP 다이제스트 자격 증명을 가져옵니다. |
| IssuedToken |
로컬 보안 토큰 서비스에 연결할 때 사용할 엔드포인트 주소 및 바인딩을 지정하려면 이 속성을 사용합니다. 이 정보는 서비스에서 발급된 토큰을 사용하여 인증을 필요로 하지만 서비스 정책(클라이언트에서 바인딩으로 표시됨)이 발급된 토큰을 가져오는 방법과 위치를 명시적으로 지정하지 않는 경우에 사용됩니다. |
| Peer |
피어 노드가 메시의 다른 노드에 인증하는 데 사용하는 자격 증명과 피어 노드가 다른 피어 노드를 인증하는 데 사용하는 인증 설정을 제어합니다. |
| SecurityTokenHandlerCollectionManager |
클라이언트 자격 증명에 대한 보안 토큰 처리기를 가져오거나 설정합니다. |
| ServiceCertificate |
서비스의 X.509 인증서를 지정하는 데 사용되는 개체를 가져옵니다. |
| SupportInteractive |
필요한 경우 시스템에서 사용자에게 자격 증명을 대화형으로 표시할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다. 예를 들어 |
| UseIdentityConfiguration |
클라이언트 자격 증명이 ID 구성을 사용하는지 여부를 가져오거나 설정합니다. |
| UserName |
클라이언트가 서비스에 인증하는 데 사용하는 사용자 이름 및 암호를 설정하는 데 사용할 수 있는 자격 증명 개체를 가져옵니다. |
| Windows |
클라이언트가 서비스에 인증하는 데 사용하는 Windows 자격 증명을 제어하는 데 사용되는 개체를 가져옵니다. |
메서드
| Name | Description |
|---|---|
| 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) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| IEndpointBehavior.AddBindingParameters(ServiceEndpoint, BindingParameterCollection) |
바인딩 매개 변수 컬렉션에 이 클래스의 인스턴스를 추가합니다. |
| IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint, EndpointDispatcher) |
엔드포인트에서 서비스의 수정 또는 확장을 구현합니다. |
| IEndpointBehavior.Validate(ServiceEndpoint) |
향후 사용을 위해 예약됨. |