Solved

ClaimPrincipal Read Group list into string

Posted on 2014-11-06
1
205 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

10 Experts available now in Live!

Get 1:1 Help Now