Loading ...

Code for DemandActionClaim helper method

 /5
0 (0votes)

public static void DemandActionClaim(string claimValue)

{

    foreach (ClaimSet claimSet in OperationContext.Current

                                                   .ServiceSecurityContext

                                                   .AuthorizationContext

                                                   .ClaimSets)

    {

        foreach (Claim claim in claimSet)

        {

            if (AccessControlHelper.CheckClaim(claim.ClaimType,

            claim.Resource.ToString(),

            "http://docs.oasis-open.org/wsfed/authorization/200706/claims/action",

            claimValue))

            {

                if (AccessControlHelper.IsIssuedByIbn(claimSet))

                {

                    return;

                }

            }

        }

    }

    throw new FaultException("Access denied.");

}

Comments (no comments yet)

Top Posts