ClaimSet 클래스

정의

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

public ref class ClaimSet abstract : System::Collections::Generic::IEnumerable<System::IdentityModel::Claims::Claim ^>
public abstract class ClaimSet : System.Collections.Generic.IEnumerable<System.IdentityModel.Claims.Claim>
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.xmlsoap.org/ws/2005/05/identity")]
public abstract class ClaimSet : System.Collections.Generic.IEnumerable<System.IdentityModel.Claims.Claim>
type ClaimSet = class
    interface seq<Claim>
    interface IEnumerable
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.xmlsoap.org/ws/2005/05/identity")>]
type ClaimSet = class
    interface seq<Claim>
    interface IEnumerable
Public MustInherit Class ClaimSet
Implements IEnumerable(Of Claim)
상속
ClaimSet
파생
특성
구현

예제

public class MyServiceAuthorizationManager : ServiceAuthorizationManager
{

    protected override bool CheckAccessCore(OperationContext operationContext)
    {
        // Extract the action URI from the OperationContext. Match this against the claims
        // in the AuthorizationContext.

        string action = operationContext.RequestContext.RequestMessage.Headers.Action;
        Console.WriteLine("action: {0}", action);

        // Iterate through the various claim sets in the AuthorizationContext.
        foreach (ClaimSet cs in operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets)
        {
            // Examine only those claim sets issued by System.
            if (cs.Issuer == ClaimSet.System)
            {
                // Iterate through claims of type "http://example.org/claims/allowedoperation".
                foreach (Claim c in cs.FindClaims("http://example.org/claims/allowedoperation",
                    Rights.PossessProperty))
                {
                    // Write the claim resource to the console.
                    Console.WriteLine("resource: {0}", c.Resource.ToString());

                    // If the claim resource matches the action URI then return true to allow access.
                    if (action == c.Resource.ToString())
                        return true;
                }
            }
        }

        // If this point is reached, return false to deny access.
        return false;
    }
}
Public Class MyServiceAuthorizationManager
    Inherits ServiceAuthorizationManager

    Protected Overrides Function CheckAccessCore(ByVal operationContext As OperationContext) As Boolean

        ' Extract the action URI from the OperationContext. Match this against the claims
        ' in the AuthorizationContext.
        Dim action As String = operationContext.RequestContext.RequestMessage.Headers.Action
        Console.WriteLine("action: {0}", action)

        ' Iterate through the various claim sets in the AuthorizationContext.
        Dim cs As ClaimSet

        For Each cs In operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets
            ' Examine only those claim sets issued by System.
            If cs.Issuer Is ClaimSet.System Then
                ' Iterate through claims of type "http://example.org/claims/allowedoperation".
                Dim c As Claim
                For Each c In cs.FindClaims("http://example.org/claims/allowedoperation", Rights.PossessProperty)
                    ' Write the claim resource to the console.
                    Console.WriteLine("resource: {0}", c.Resource.ToString())

                    ' If the claim resource matches the action URI then return true to allow access
                    If action = c.Resource.ToString() Then
                        Return True
                    End If
                Next c
            End If
        Next cs
        ' 
        ' If this point is reached, return false to deny access.
        Return False

    End Function

설명

클래스를 ClaimSet 만든 후에는 변경할 수 없습니다.

클레임 기반 권한 부여를 ClaimSet 사용하는 경우 특정 유형의 클레임에 대한 콘텐츠를 검사하는 것이 일반적인 작업입니다. 특정 클레임이 있는지 확인하려면 ClaimSet를 검사하는 메서드 FindClaims을 사용하세요. 메서드를 통해 직접 ClaimSet반복 하는 것 보다 더 나은 성능을 제공 합니다.

생성자

Name Description
ClaimSet()

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

속성

Name Description
Count

파생 클래스에서 재정의되는 경우 이 클레임 집합의 클레임 수를 가져옵니다.

Issuer

파생 클래스에서 재정의되는 경우 이를 ClaimSet발급한 엔터티를 가져옵니다.

Item[Int32]

파생 클래스에서 재정의되는 경우 지정된 인덱스 Claim 값을 가져옵니다.

System

ClaimSet 애플리케이션에서 신뢰할 수 있는 발급자를 나타내는 개체를 가져옵니다.

Windows

Windows 보안 식별자를 포함하는 클레임 집합을 가져옵니다.

메서드

Name Description
ContainsClaim(Claim, IEqualityComparer<Claim>)

지정된 ClaimSet 개체를 Claim 사용하여 지정된 IEqualityComparer<T>개체를 포함하는지 여부를 확인합니다.

ContainsClaim(Claim)

지정된 ClaimSet을 포함하는지 여부를 Claim 확인합니다.

Equals(Object)

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

(다음에서 상속됨 Object)
FindClaims(String, String)

파생 클래스에서 재정의되는 경우 지정된 클레임 형식 및 권한Claim과 일치하는 개체를 검색 ClaimSet 합니다.

GetEnumerator()

파생 클래스에서 재정의되는 경우 개체를 IEnumerator<T> 열거 Claim 하는 데 사용할 수 있는 ClaimSet값을 가져옵니다.

GetHashCode()

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
IEnumerable.GetEnumerator()

에서 개체를 IEnumerator<T> 열거 Claim 하는 데 사용할 수 있는 ClaimSet값을 가져옵니다.

확장명 메서드

Name Description
ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

IEnumerable<T> IAsyncEnumerable<T>변환합니다.

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

지정된 키 선택기 및 요소 선택기 함수에 따라 FrozenDictionary<TKey,TValue>IEnumerable<T> 만듭니다.

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

FrozenDictionary<TKey,TValue> 지정된 키 선택기 함수에 IEnumerable<T> 따라 해당 키 선택기 함수에서 a를 만듭니다.

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

지정된 값을 사용하여 만듭니 FrozenSet<T> 다.

ToImmutableArray<TSource>(IEnumerable<TSource>)

지정된 컬렉션에서 변경할 수 없는 배열을 만듭니다.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

시퀀스를 열거 및 변환하고 지정된 키 및 값 비교자를 사용하여 해당 내용의 변경할 수 없는 사전을 생성합니다.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

시퀀스를 열거 및 변환하고 지정된 키 비교자를 사용하여 해당 내용의 변경할 수 없는 사전을 생성합니다.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

시퀀스를 열거 및 변환하고 해당 내용의 변경할 수 없는 사전을 생성합니다.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

시퀀스의 일부 변환을 기반으로 변경할 수 없는 사전을 생성합니다.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

원본 키에 변환 함수를 적용하여 기존 요소 컬렉션에서 변경할 수 없는 사전을 생성합니다.

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

시퀀스를 열거하고, 해당 내용의 변경할 수 없는 해시 집합을 생성하며, 집합 형식에 대해 지정된 같음 비교자를 사용합니다.

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

시퀀스를 열거하고 해당 내용의 변경할 수 없는 해시 집합을 생성합니다.

ToImmutableList<TSource>(IEnumerable<TSource>)

시퀀스를 열거하고 해당 내용의 변경할 수 없는 목록을 생성합니다.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

시퀀스를 열거 및 변환하고 지정된 키 및 값 비교자를 사용하여 해당 내용의 변경할 수 없는 정렬된 사전을 생성합니다.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

시퀀스를 열거 및 변환하고 지정된 키 비교자를 사용하여 변경 불가능한 정렬된 해당 내용 사전을 생성합니다.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

시퀀스를 열거 및 변환하고 해당 내용의 변경할 수 없는 정렬된 사전을 생성합니다.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

시퀀스를 열거하고, 변경할 수 없는 정렬된 콘텐츠 집합을 생성하고, 지정된 비교자를 사용합니다.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

시퀀스를 열거하고 변경할 수 없는 정렬된 콘텐츠 집합을 생성합니다.

적용 대상