1

I would like my BDC ReadList()-operation to fetch objects based on email from a user claim. I tried using IClaimsPrincipal in a webpart, with no problem, but I can't get it to work in BDC model.

Basically I would like to do something like this:

ReadList() { 1. Get Claims object 2. Get email from claims object 3. Ask query with that email 4. return query result }

Any thoughts/ideas on this matter would be greatly appriciated.

  • Basically I found this: private static IClaimsIdentity GetClaimsIdentity() { IClaimsPrincipal claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal; if (claimsPrincipal != null) { return (IClaimsIdentity)claimsPrincipal.Identity; } return new ClaimsIdentity(); } Now I have the claimsIdentity. From this I can use Linq to extract the claims: IEnumerable claims = (from c in identity.Claims select c).Distinct().ToList(); return claims; Hopes this can be of help. – MattiasMirhagen May 14 '10 at 08:07

0 Answers0