Solved

ClaimPrincipal Read Group list into string

Posted on 2014-11-06
1
211 Views
Last Modified: 2014-11-07
I have this code:

 var claim = cp.FindFirst(ClaimGroup);

This will give me one group (works fine). The first one. But some people have more than 1 group. I need all the groups to be in 1 string/var

I tried something with foreach and FindAll .. but i can't figure it out. Can someone help?
0
Comment
Question by:A. Amien
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 40428036
Assuming you mean ClaimsPrincipal (not ClaimPrincipal as in your question title) then the FindFirst returns a Claim object.  
What do you expect when you pack more than one Claim into a string ?

ps.  something like the following should work
string s;
foreach(Claim c in cp.FindAll(ClaimGroup))
{
  s +=   //now do something with the returned Claim object to append it to the string
}
0

Featured Post

Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now