ClaimSet 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
엔터티와 연결된 클레임의 컬렉션을 나타냅니다.
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) | |
| 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값을 가져옵니다. |