Last post Feb 17, 2017 04:39 PM by johnzee
Feb 16, 2017 06:59 PM|johnzee|LINK
I have this code in the page_load event of a webform. I need to see if a person authenticated against claims is also a member of the finance-users group. If Yes then proceed to the finance page otherwise direct them to the Error page. In the the ADFS groups,
users are entered as John Doe while ClaimsPrincipal is returning an AD user as Doe, John. Even the user who exists in the group keeps getting redirected to the error page. How do I extend this method to only look for the current logged in users in a group
in the proper name format like first last? I am using this code:
Feb 17, 2017 03:16 AM|Zhi Lv - MSFT|LINK
As we all known,
the ClaimsPrincipal.IsInRole Method is used to indicates whether the entity (user) represented by this claims principal is in
the specified role.
So, please make sure you have the "Finance-Users" role.
Besides, I suggest refer to this thread with the similar problem.
Feb 17, 2017 04:39 PM|johnzee|LINK
Thanks for trying to help but my problem is different than the link you suggested. I know the group exists in AD and user is in the group however the name formats are different and so it doesn't compare to be true. Like I said Finance-users group members
are listed as "John Doe" but ClaimsPrincipal.Current.IsInRole is looking for a user name like "Doe John" so it's not finding the true match.