If I am not mistaken, there are different ways to get a claim to WCF.
Thread.CurrentPrincipal . It is simple and convenient to use, but in the configuration you need to set some parameters that are most ignored.
<behaviors> <serviceBehaviors> <behavior name="Test.Services.WifBehavior"> <serviceCredentials useIdentityConfiguration="true" /> <serviceAuthorization principalPermissionMode="Always"/> </behavior> <serviceBehaviors> </behaviors>
OperationContext.Current.ClaimsPrincipal . I canβt remember if this configuration is needed, but I think you can get it directly from the called method.
OperationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets - Create a custom authorization manager for the service and you need to add configuration to it.
Please note that I used the Windows Identity Foundation (WIF).
source share