Solved

ClaimPrincipal Read Group list into string

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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