I am creating a simple WebApi that allows users to connect to Facebook. When I get the accessToken back from facebook, I call RegisterExternal to create an Identity Asp.Net entry and store the claims from the token. These claims also include the access token that I need for a subsequent facebook schedule request. Everything seems to be fine.
The problem I am facing is reading the claims. I see that they are in my database. I just can't figure out how to request this data. I tried
var claimsIdentity = User.Identity as ClaimsIdentity;
But this returns me 2 claims a) " http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name " b) role
Both of them belong to the publisher of LOCAL AUTHORITY (to be honest, I'm not sure when they are created, since I am not adding them explicitly). Therefore, I believe that they either confuse me, keeping the claims in the database for the wrong type of issuer
await userManager.AddClaimAsync(user.Id, new Claim("urn:facebook:access_token", accessTokenClaim.Value, ClaimValueTypes.String, "LOCAL AUTHORITY"));
or my claim code is incorrect.
Can anyone shed some light on this?
source share