Wednesday, 23 May 2012

Retrieving Claims Values in SP2010

Problem:  Developer wants to retrieve values from the users claim to send an email.

Intial Hypothesis:  Create a web part to demonstrate the code that displays all the claim values.  Pull out the claim values such as the UPN in my case and send an email to the current user based on the upn value.  The upn in my dev machine is the users email address but it obviously depends on how you claims are setup.

Resolution:  Create a new SharePoint project and add a web part.  Then add the code as shown below.
Updated 28 May 2012 - Format of claims post
Example from ADFS2.0 connecting to AD:  "i:0ǽ.t|mkting|testuser"

0 comments:

Post a comment