Claim 클래스

정의

엔터티와 연결된 클레임을 나타냅니다.

public ref class Claim
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.xmlsoap.org/ws/2005/05/identity")]
public class Claim
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.xmlsoap.org/ws/2005/05/identity")>]
type Claim = class
Public Class Claim
상속
Claim
특성

예제

// Run this method from within a method protected by the PrincipalPermissionAttribute
// to see the security context data, including the primary identity.
public void WriteServiceSecurityContextData(string fileName)
{
    using (StreamWriter sw = new StreamWriter(fileName))
    {
        // Write the primary identity and Windows identity. The primary identity is derived from the
        // the credentials used to authenticate the user. The Windows identity may be a null string.
        sw.WriteLine("PrimaryIdentity: {0}", ServiceSecurityContext.Current.PrimaryIdentity.Name);
        sw.WriteLine("WindowsIdentity: {0}", ServiceSecurityContext.Current.WindowsIdentity.Name);
        sw.WriteLine();
        // Write the claimsets in the authorization context. By default, there is only one claimset
        // provided by the system.
        foreach (ClaimSet claimset in ServiceSecurityContext.Current.AuthorizationContext.ClaimSets)
        {
            foreach (Claim claim in claimset)
            {
                // Write out each claim type, claim value, and the right. There are two
                // possible values for the right: "identity" and "possessproperty".
                sw.WriteLine("Claim Type = {0}", claim.ClaimType);
                sw.WriteLine("\t Resource = {0}", claim.Resource.ToString());
                sw.WriteLine("\t Right = {0}", claim.Right);
            }
        }
    }
}
' Run this method from within a method protected by the PrincipalPermissionAttribute
' to see the security context data, including the primary identity.
Public Sub WriteServiceSecurityContextData(ByVal fileName As String)
    Dim sw As New StreamWriter(fileName)
    Try
        ' Write the primary identity and Windows identity. The primary identity is derived from the
        ' the credentials used to authenticate the user. The Windows identity may be a null string.
        sw.WriteLine("PrimaryIdentity: {0}", ServiceSecurityContext.Current.PrimaryIdentity.Name)
        sw.WriteLine("WindowsIdentity: {0}", ServiceSecurityContext.Current.WindowsIdentity.Name)
        sw.WriteLine()
        ' Write the claimsets in the authorization context. By default, there is only one claimset
        ' provided by the system. 
        Dim claimset As ClaimSet
        For Each claimset In ServiceSecurityContext.Current.AuthorizationContext.ClaimSets
            Dim claim As Claim
            For Each claim In claimset
                ' Write out each claim type, claim value, and the right. There are two
                ' possible values for the right: "identity" and "possessproperty". 
                sw.WriteLine("Claim Type = {0}", claim.ClaimType)
                sw.WriteLine(vbTab + " Resource = {0}", claim.Resource.ToString())
                sw.WriteLine(vbTab + " Right = {0}", claim.Right)
            Next claim
        Next claimset
    Finally
        sw.Dispose()
    End Try

End Sub

설명

ID 모델은 클레임 기반 권한 부여 시스템입니다. 클레임은 시스템의 일부 엔터티(종종 해당 시스템의 사용자)와 관련된 기능을 설명합니다. 지정된 엔터티와 연결된 클레임 집합을 키로 생각할 수 있습니다. 특정 클레임은 해당 키의 모양을 정의합니다. 실제 키처럼 문에 잠금을 여는 데 사용됩니다. 이러한 방식으로 클레임은 리소스에 대한 액세스 권한을 얻는 데 사용됩니다. 지정된 보호된 리소스에 대한 액세스는 해당 리소스에 액세스하는 데 필요한 클레임과 액세스를 시도하는 엔터티와 연결된 클레임을 비교하여 결정됩니다.

클레임은 특정 값과 관련된 권한의 식입니다. 권리는 읽거나 쓰거나 소유할 수 있습니다. 값은 데이터베이스, 파일, 사서함 또는 속성일 수 있습니다. 클레임에는 클레임 형식도 있습니다. 클레임 유형과 권한의 조합은 값과 관련하여 지정되는 기능에 대한 메커니즘을 제공합니다. 예를 들어 값 biography.doc 위에 오른쪽 read 이 있는 형식 file 의 클레임은 이러한 클레임이 있는 엔터티가 파일 biography.doc 대한 읽기 권한이 있음을 나타냅니다. 값 위에 오른쪽 PossessProperty 이 있는 형식 이름의 클레임은 클레임이 있는 엔터티에 값Martin이 인 Name 속성이 있음을 Martin 나타냅니다.

다양한 클레임 유형 및 권한이 ID 모델의 일부로 정의되지만 시스템은 확장할 수 있습니다. ID 모델 인프라를 기반으로 빌드되는 다양한 시스템은 필요에 따라 클레임 유형 및 권한을 정의할 수 있습니다.

생성자

Claim(String, Object, String)

지정된 형식, 리소스, 권한을 사용하여 Claim 클래스의 새 인스턴스를 초기화합니다.

속성

ClaimType

클레임의 형식을 가져옵니다.

DefaultComparer

두 개의 Claim 개체가 같은지 비교할 수 있는 개체를 가져옵니다.

Resource

Claim 개체가 연결된 리소스를 가져옵니다.

Right

Claim 개체와 연결된 권한을 지정하는 URI(Uniform Resource Identifier)의 문자열 표현입니다. 미리 정의된 권한은 Rights 클래스의 정적 속성으로 사용할 수 있습니다.

System

시스템 엔터티를 나타내는 미리 정의된 클레임입니다.

메서드

CreateDenyOnlyWindowsSidClaim(SecurityIdentifier)

지정된 거부 전용 SID(보안 식별자)를 나타내는 Claim 개체를 만듭니다.

CreateDnsClaim(String)

지정된 DNS(Domain Name System) 이름을 나타내는 Claim 개체를 만듭니다.

CreateHashClaim(Byte[])

지정된 해시 값을 나타내는 Claim 개체를 만듭니다.

CreateMailAddressClaim(MailAddress)

지정된 전자 메일 주소를 나타내는 Claim 개체를 만듭니다.

CreateNameClaim(String)

지정된 이름을 나타내는 Claim 개체를 만듭니다.

CreateRsaClaim(RSA)

지정된 RSA 키를 나타내는 Claim 개체를 만듭니다.

CreateSpnClaim(String)

지정된 SPN(Service Principal Name)을 나타내는 Claim 개체를 만듭니다.

CreateThumbprintClaim(Byte[])

지정된 지문을 나타내는 Claim 개체를 만듭니다.

CreateUpnClaim(String)

지정된 UPN(Universal Principal Name)을 나타내는 Claim 개체를 만듭니다.

CreateUriClaim(Uri)

지정된 URL(Uniform Resource Locator)을 나타내는 Claim 개체를 만듭니다.

CreateWindowsSidClaim(SecurityIdentifier)

지정된 SID(보안 식별자)를 나타내는 Claim 개체를 만듭니다.

CreateX500DistinguishedNameClaim(X500DistinguishedName)

지정된 X.500 고유 이름을 나타내는 Claim 개체를 만듭니다.

Equals(Object)

지정된 개체가 현재 Claim 개체와 동일한 클레임을 나타내는지 여부를 확인합니다.

GetHashCode()

현재 클레임에 대한 해시 코드를 반환합니다.

GetType()

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

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

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

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

Claim 개체의 문자열 표현을 반환합니다.

적용 대상