<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zubair&#039;s Blog</title>
	<atom:link href="http://shojeeb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shojeeb.com</link>
	<description>So what&#039;s up Zuby</description>
	<lastBuildDate>Mon, 08 Nov 2010 22:21:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SharePoint Federation Utility ( SPFedUtil.exe )</title>
		<link>http://shojeeb.com/sharepoint/sharepoint-federation-utility-spfedutil-exe/</link>
		<comments>http://shojeeb.com/sharepoint/sharepoint-federation-utility-spfedutil-exe/#comments</comments>
		<pubDate>Wed, 12 May 2010 03:57:41 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Claim Provider]]></category>
		<category><![CDATA[Claims]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=168</guid>
		<description><![CDATA[I have been thinking about this for a little while, but finally found a reason to make it myself. If you have worked with Windows Identity Foundation SDK in the past you might have spotted a very handy utility called FedUtil.exe. If you installed the SDK in the default location its located at &#8220;C:\Program Files [...]]]></description>
			<content:encoded><![CDATA[<p>I have been thinking about this for a little while, but finally found a reason to make it myself. If you have worked with Windows Identity Foundation SDK in the past you might have spotted a very handy utility called FedUtil.exe. If you installed the SDK in the default location its located at &#8220;C:\Program Files (x86)\Windows Identity Foundation SDK\v3.5&#8243; folder. Or if you are a developer you might have noticed the &#8220;Update STS reference&#8221; button while working on a standard ASP.NET web application. This tool is great when you are working with ADFS 2.0 or any other standards compliant identity provider. This utility configures the ASP.NET web application and produces relying party metadata which could be later sent to the identity provider so that too could be configured to issue claims to this relying party.</p>
<p>SharePoint is a ASP.NET web application however because of SharePoint specific deployment scenarios this tool is not very useful in a SharePoint context. So i have attempted to create a utility that could be used for similar purposes. SPFedUtil.exe features as it stands today [4:40pm 12/05/2010]</p>
<ul>
<li>Displays currently configured SharePoint trusted login providers</li>
<li>Enables configuration of trusted login provider name and realm</li>
<li>Federation metadata consumption from a server or file system</li>
<li>Identity provider certificate verification and CA configuration</li>
<li>Augmenting list of claims provided by identity provider with a CSV file</li>
<li>Specifying SharePoint user identity claim type</li>
<li>Specifying SharePoint claim provider for this trusted login provider</li>
<li>SharePoint replying party metadata configuration, including contact and organization info</li>
<li>Configures SharePoint trusted login provider using PowerShell (can be run from the util)</li>
<li>Emailing of generated relying party metadata to identity provider technical contact</li>
</ul>
<p><a href="wp-content/uploads/downloads/2010/05/SPFedUtil1.zip">This utility can be found here [download id="2" format="1"] Please feel free to mention this blog as the source of this utility.</a></p>
<p>I wont clutter up this post with all the images and how to instructions for this utility. I have created a separate project site <a href="http://shojeeb.com/projects/spfedutil/">here</a>. I will endevour to put full how-to documentation on that page. But for now here are a couple of screenshots<br />
<a href="http://shojeeb.com/projects/spfedutil/"><img class="alignleft size-medium wp-image-177" title="overview" src="http://shojeeb.com/wp-content/uploads/2010/05/overview-300x243.png" alt="" width="300" height="243" /></a><br />
<a href="http://shojeeb.com/projects/spfedutil/"><img src="http://shojeeb.com/wp-content/uploads/2010/05/page3-300x222.png" alt="" title="page3" width="300" height="222" class="alignleft size-medium wp-image-190" /></a><br />
<a href="http://shojeeb.com/projects/spfedutil/"><img src="http://shojeeb.com/wp-content/uploads/2010/05/page7-300x222.png" alt="" title="page7" width="300" height="222" class="alignleft size-medium wp-image-191" /></a><br />
<a href="http://shojeeb.com/projects/spfedutil/"><img src="http://shojeeb.com/wp-content/uploads/2010/05/page9-300x222.png" alt="" title="page9" width="300" height="222" class="alignleft size-medium wp-image-192" /></a></p>
<div style="clear:both;">&nbsp;</div>
<p>[4:44 21/05/2010] Update :  bug fixed &#8211; Identity provider sign in URL not configured properly during SharePoint trusted provider setup. This now retrieves the sign in URL from the IdP metadata.</p>
<p>This is a beta tool and thus should be used with caution :D </p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/sharepoint-federation-utility-spfedutil-exe/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
		<item>
		<title>Custom social bookmarking ribbon tab in SharePoint 2010</title>
		<link>http://shojeeb.com/sharepoint/custom-social-bookmarking-ribbon-tab-in-sharepoint-2010/</link>
		<comments>http://shojeeb.com/sharepoint/custom-social-bookmarking-ribbon-tab-in-sharepoint-2010/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 09:46:51 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Ribbon]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=125</guid>
		<description><![CDATA[I have been investigating SharePoint 2010 ribbon lately. While doing so i came across some useful documentation posted on both Microsoft and personal blogs. I have listed some of the more useful resources at one of my earlier post. Based on these resources I have created a social bookmarking ribbon tab similar to the ones [...]]]></description>
			<content:encoded><![CDATA[<p>I have been investigating SharePoint 2010 ribbon lately. While doing so i came across some useful documentation posted on both Microsoft and personal blogs. I have listed some of the more useful resources at one of my <a href="http://shojeeb.com/sharepoint/resources-for-creating-your-own-ribbon-in-sharepoint-2010/">earlier post</a>. Based on these resources I have created a social bookmarking ribbon tab similar to the ones found in some blogs and social sites. This post is to share the implementation and some basic findings. Some of these findings are based on experiences in creating the social bookmarking ribbon and might not be the best practice for the final version of SharePoint 2010.</p>
<p>End result &#8230; download at the end of the post<br />
<a href="http://shojeeb.com/wp-content/uploads/2010/04/sp-socialize-feature.png"><img src="http://shojeeb.com/wp-content/uploads/2010/04/sp-socialize-feature.png" alt="" title="sp-socialize-feature" width="569" height="136" class="size-full wp-image-130" /></a></p>
<p>See it in action here &#8230;<br />
httpv://www.youtube.com/watch?v=trQgdexZC6I</p>
<p>Following list summaries the minimal steps that are required to create a ribbon tab or contextual group</p>
<ul>
<li>Location attribute of CustomAction must be as follows
<pre name="code" class="xml">&lt;CustomAction Id=&quot;Cecil.Ribbon.Socialize&quot; Title=&quot;Socialize&quot; Location=&quot;CommandUI.Ribbon&quot;&gt;</pre>
</li>
<li>Location attribute of CommandUIDefinition must be either of the following
<pre name="code" class="xml">&lt;CommandUIDefinition Location=&quot;Ribbon.Tabs._children&quot;&gt;
or
&lt;CommandUIDefinition Location=&quot;Ribbon.ContextualTabs._children&quot;&gt;</pre>
<p>Former is required for Tabs and later is for ContextualGroup</li>
<li>Fill in CommandUIDefinition while adhering to the schema which can be found at {14HIVE}<strong>\TEMPLATE\GLOBAL\XML\CMDUI.XM</strong>L</li>
<li>Create a custom <strong>CUI.Page.PageComponent</strong> and place it in the _layouts folder</li>
<li>Place all the command names in either <strong>getGlobalCommands</strong> or <strong>getFocusedCommands</strong></li>
<li>If your ribbon is in a state when the tab or contextual group should be visible then make sure <strong>canHandleCommand</strong> returns true</li>
<li>If your button or other control is in a state when they can be pressed make sure <strong>canHandleCommand</strong> returns true</li>
<li>Run code specific to each command in <strong>handleCommand</strong> method based on the <strong>commandId</strong></li>
<li>Include a reference to <strong>Microsoft.Web.CommandUI.dll</strong> in your project</li>
<li>Include the <strong>CUI.Page.PageComponent</strong> source file then register it by making it available in a web control.
<pre name="code" class="c-sharp"> public class SocializeBootstrapper : WebControl
    {
        protected override void OnPreRender(EventArgs e)
        {
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;SP.Core.js&quot;, false, true);
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;CUI.js&quot;, false, true);
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;core.js&quot;, true, false);
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;SP.Ribbon.js&quot;, false, true);
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;SP.Runtime.js&quot;, false, true);
            ScriptLink.RegisterScriptAfterUI(this.Page, &quot;SP.js&quot;, false, true);
            ScriptLink.RegisterScriptAfterUI(this.Page,
                        &quot;SPCecil.Socialize/Socialize.UI.js&quot;, false, true);

            SPRibbon currentRibbon = SPRibbon.GetCurrent(this.Page);
            currentRibbon.MakeTabAvailable(&quot;Cecil.Ribbon.Socialize.Tab&quot;);

            base.OnPreRender(e);
        }
    }</pre>
</li>
<li>The load the control using DelegateControl
<pre name="code" class="xml">&lt;Control
		Id=&quot;AdditionalPageHead&quot;
		Sequence=&quot;200&quot;
		ControlClass=&quot;$SharePoint.Project.FileNameWithoutExtension$.SocializeBootstrapper&quot;
		ControlAssembly=&quot;$SharePoint.Project.AssemblyFullName$&quot;&gt;
&lt;/Control&gt;</pre>
</li>
</ul>
<p>[download id="1" format="1"]<br />
If you want to change the button images around its pretty easy to do so, check out this <a href="http://icondock.com/free/vector-social-media-icons">social image set</a> and replace them in the _layouts folder.<br />
if you find this solution helpful please have a link back to this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/custom-social-bookmarking-ribbon-tab-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Resources for creating your own Ribbon in SharePoint 2010</title>
		<link>http://shojeeb.com/sharepoint/resources-for-creating-your-own-ribbon-in-sharepoint-2010/</link>
		<comments>http://shojeeb.com/sharepoint/resources-for-creating-your-own-ribbon-in-sharepoint-2010/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 04:47:52 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Ribbon]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=119</guid>
		<description><![CDATA[After the Microsoft presentation yesterday i am becoming more and more convinced about the usability and effectiveness of office ribbon in SharePoint 2010. Being the geek i am i would not fully convinced till i had a go at making my own. I am still trying to figure it out so hopefully in the near [...]]]></description>
			<content:encoded><![CDATA[<p>After the Microsoft presentation yesterday i am becoming more and more convinced about the usability and effectiveness of office ribbon in SharePoint 2010. Being the geek i am i would not fully convinced till i had a go at making my own. I am still trying to figure it out so hopefully in the near future I will have something to share with other developers. Its very hard to find good documnetation on Ribbon at this stage so i thought i post the link that i found most useful thus far.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=c010fc68-b47f-4db6-b8a8-ad4ba33a35c5">Microsoft&#8217;s SharePoint hands on labs, not that detailed yet but should help get started</a></p>
<p><a href="http://blogs.msdn.com/sharepointdeveloperdocs/archive/2010/01/28/how-to-create-a-web-part-with-a-contextual-tab.aspx">Microsoft SharePoint Developer Documentation Blog, just found it very good</a> [7:39 16/4/2010]</p>
<p><a href="http://www.sharepointnutsandbolts.com/2010/01/adding-ribbon-items-into-existing.html">Chris O&#8217;Brien&#8217;s Blog, found this to be most helpful</a></p>
<p><a href="http://www.wictorwilen.se/Post/Creating-a-SharePoint-2010-Ribbon-extension-part-1.aspx">Wictor Wilén Blog, there is a custom action that he created for quick list creation might use that myself :D</a></p>
<p>Hope this helps others</p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/resources-for-creating-your-own-ribbon-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>142</slash:comments>
		</item>
		<item>
		<title>Displaying personal session Claims in SP2010 with BCS</title>
		<link>http://shojeeb.com/sharepoint/displaying-personal-session-claims-in-sharepoint-2010-with-bcs/</link>
		<comments>http://shojeeb.com/sharepoint/displaying-personal-session-claims-in-sharepoint-2010-with-bcs/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 05:09:27 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[BCS]]></category>
		<category><![CDATA[Claims]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=99</guid>
		<description><![CDATA[I have seen some posts on the web showing how to display session claims for the logged in user by iterating through the claims HttpContext.Current.User in a webpart. However it seemed a bit dull for SharePoint 2010 which has so much fire in its belly. I quite like the concept of Business Connectivity Services (BCS) [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen some posts on the web showing how to display session claims for the logged in user by iterating through the claims HttpContext.Current.User in a webpart. However it seemed a bit dull for SharePoint 2010 which has so much fire in its belly. I quite like the concept of Business Connectivity Services (BCS) and while investigating it for possible use i thought this might be the simplest implementation that anyone could ever try out. However there are some benefits to using BCS. For example you can create custom view from the UI without writing additional code, for example <strong>show all course role claims in alphabetical order</strong>. You can also connect it up with other lists using SharePoint WebPart connections to drive another webpart, for example <strong>based on the course role claims selected show course details web part</strong>. Again the examples are Academic institution related but i am sure you guys can think of examples that relate to your organization. So this is the code. SPCecil.Connect.MyClaimsDataModel is the namespace for my classes.</p>
<pre name="code" class="c-sharp">
    public partial class MyClaim
    {
        public string Identifier { get; set; }
        public string ClaimType { get; set; }
        public string Value { get; set; }
        public string Issuer { get; set; }
        public string OriginalIssuer { get; set; }
        public string ValueType { get; set; }
    }

    public class MyClaimService
    {
        public static MyClaim ReadItem(string id)
        {
            IClaimsIdentity identity = GetClaimsIdentity();
            string[] parts = id.Split(new string[] { &quot;::&quot; },
                        2, StringSplitOptions.RemoveEmptyEntries);
            if (parts != null &amp;amp;&amp;amp; parts.Length == 2)
            {
                var claimsOfType = (from c in identity.Claims
                                    where c.ClaimType == parts[0]
                                    select c).ToArray();
                int index = Convert.ToInt32(parts[1]);
                if (claimsOfType != null &amp;amp;&amp;amp; claimsOfType.Length &amp;gt; index)
                {
                    Claim selectedClaim = claimsOfType[index];
                    return new MyClaim()
                    {
                        Identifier = id,
                        Value = selectedClaim.Value,
                        ValueType = selectedClaim.ValueType,
                        ClaimType = selectedClaim.ClaimType,
                        Issuer = selectedClaim.Issuer,
                        OriginalIssuer = selectedClaim.OriginalIssuer
                    };
                }
            }
            return null;
        }

        public static IEnumerable ReadList()
        {
            IClaimsIdentity identity = GetClaimsIdentity();
            var claimTypes = (from c in identity.Claims select c.ClaimType).Distinct();
            List myClaims = new List();
            foreach (string claimType in claimTypes)
            {
                var claims = from c in identity.Claims
                             where c.ClaimType == claimType
                             select c;
                int index = 0;
                foreach (Claim c in claims)
                {
                    myClaims.Add(new MyClaim()
                     {
                         Identifier = c.ClaimType + &quot;::&quot; + index,
                         Value = c.Value,
                         ValueType = c.ValueType,
                         ClaimType = c.ClaimType,
                         Issuer = c.Issuer,
                         OriginalIssuer = c.OriginalIssuer
                     });
                    index++;
                }
            }
            return myClaims.ToArray();
        }

        private static IClaimsIdentity GetClaimsIdentity()
        {
            IClaimsPrincipal claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal;
            if (claimsPrincipal != null)
            {
                return (IClaimsIdentity)claimsPrincipal.Identity;
            }
            return new ClaimsIdentity();
        }
    }
</pre>
<p>And the model definition should look something like this&#8230;</p>
<pre name="code" class="xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;Model xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://schemas.microsoft.com/windows/2007/BusinessDataCatalog&quot; Name=&quot;MyClaimsDataModel&quot;&gt;
  &lt;LobSystems&gt;
    &lt;LobSystem Name=&quot;MyClaimsDataModel&quot; Type=&quot;DotNetAssembly&quot;&gt;
      &lt;LobSystemInstances&gt;
        &lt;LobSystemInstance Name=&quot;MyClaimsDataModel&quot; DefaultDisplayName=&quot;My Claims&quot; /&gt;
      &lt;/LobSystemInstances&gt;
      &lt;Entities&gt;
        &lt;Entity Name=&quot;MyClaim&quot; Namespace=&quot;SPCecil.Connect.MyClaimsDataModel&quot; EstimatedInstanceCount=&quot;1000&quot; Version=&quot;1.0.0.31&quot;&gt;
          &lt;Properties&gt;
            &lt;Property Name=&quot;Class&quot; Type=&quot;System.String&quot;&gt;SPCecil.Connect.MyClaimsDataModel.MyClaimService, MyClaimsDataModel&lt;/Property&gt;
          &lt;/Properties&gt;
          &lt;Identifiers&gt;
            &lt;Identifier Name=&quot;Identifier&quot; TypeName=&quot;System.String&quot; /&gt;
            &lt;!-- TODO:change the name of the ID and if needed the TypeName of your identifier.--&gt;
          &lt;/Identifiers&gt;
          &lt;Methods&gt;
            &lt;!-- start finder method--&gt;
            &lt;Method Name=&quot;ReadList&quot;&gt;
              &lt;!-- TODO:change the name of the method if needed.--&gt;
              &lt;Parameters&gt;
                &lt;Parameter Direction=&quot;Return&quot; Name=&quot;returnParameter&quot;&gt;
                  &lt;TypeDescriptor TypeName=&quot;System.Collections.Generic.IEnumerable`1[[SPCecil.Connect.MyClaimsDataModel.MyClaim, MyClaimsDataModel]]&quot; IsCollection=&quot;true&quot; Name=&quot;MyClaimList&quot;&gt;
                    &lt;TypeDescriptors&gt;
                      &lt;TypeDescriptor Name=&quot;MyClaim&quot; TypeName=&quot;SPCecil.Connect.MyClaimsDataModel.MyClaim, MyClaimsDataModel&quot;&gt;
                        &lt;TypeDescriptors&gt;
                          &lt;TypeDescriptor Name=&quot;Identifier&quot; TypeName=&quot;System.String&quot; IdentifierName=&quot;Identifier&quot; /&gt;
                          &lt;TypeDescriptor Name=&quot;ClaimType&quot; TypeName=&quot;System.String&quot; DefaultDisplayName=&quot;Claim Type&quot; /&gt;
                          &lt;TypeDescriptor Name=&quot;Value&quot; TypeName=&quot;System.String&quot; /&gt;
                          &lt;TypeDescriptor Name=&quot;ValueType&quot; TypeName=&quot;System.String&quot; DefaultDisplayName=&quot;Claim Value Type&quot; /&gt;
                          &lt;TypeDescriptor Name=&quot;Issuer&quot; TypeName=&quot;System.String&quot; /&gt;
                          &lt;TypeDescriptor Name=&quot;OriginalIssuer&quot; TypeName=&quot;System.String&quot; DefaultDisplayName=&quot;Original Issuer&quot; /&gt;&lt;/TypeDescriptors&gt;&lt;/TypeDescriptor&gt;&lt;/TypeDescriptors&gt;
                  &lt;/TypeDescriptor&gt;
                &lt;/Parameter&gt;
              &lt;/Parameters&gt;
              &lt;MethodInstances&gt;
                &lt;MethodInstance Type=&quot;Finder&quot; ReturnParameterName=&quot;returnParameter&quot; Default=&quot;true&quot; Name=&quot;ReadList&quot; DefaultDisplayName=&quot;All my claims&quot; /&gt;
              &lt;/MethodInstances&gt;
            &lt;/Method&gt;
            &lt;!-- end finder method--&gt;
            &lt;!-- start specific finder method--&gt;
            &lt;Method Name=&quot;ReadItem&quot;&gt;
              &lt;Parameters&gt;
                &lt;Parameter Direction=&quot;In&quot; Name=&quot;id&quot;&gt;
                  &lt;TypeDescriptor TypeName=&quot;System.String&quot; IdentifierName=&quot;Identifier&quot; Name=&quot;Identifier&quot; /&gt;
                &lt;/Parameter&gt;
                &lt;Parameter Direction=&quot;Return&quot; Name=&quot;returnParameter&quot;&gt;
                  &lt;TypeDescriptor TypeName=&quot;SPCecil.Connect.MyClaimsDataModel.MyClaim, MyClaimsDataModel&quot; Name=&quot;MyClaim&quot;&gt;
                    &lt;TypeDescriptors&gt;
                      &lt;TypeDescriptor TypeName=&quot;System.String&quot; IdentifierName=&quot;Identifier&quot; Name=&quot;Identifier&quot; /&gt;
                      &lt;TypeDescriptor TypeName=&quot;System.String&quot; Name=&quot;ClaimType&quot; DefaultDisplayName=&quot;Claim Type&quot; /&gt;
                      &lt;!-- TODO: add typedescriptors when you add properties to entity1.--&gt;
                      &lt;TypeDescriptor Name=&quot;Value&quot; TypeName=&quot;System.String&quot; /&gt;
                      &lt;TypeDescriptor Name=&quot;ValueType&quot; TypeName=&quot;System.String&quot; DefaultDisplayName=&quot;Claim Value Type&quot; /&gt;
                      &lt;TypeDescriptor Name=&quot;Issuer&quot; TypeName=&quot;System.String&quot; /&gt;
                      &lt;TypeDescriptor Name=&quot;OriginalIssuer&quot; TypeName=&quot;System.String&quot; DefaultDisplayName=&quot;Original Issuer&quot; /&gt;&lt;/TypeDescriptors&gt;
                  &lt;/TypeDescriptor&gt;
                &lt;/Parameter&gt;
              &lt;/Parameters&gt;
              &lt;MethodInstances&gt;
                &lt;MethodInstance Type=&quot;SpecificFinder&quot; ReturnParameterName=&quot;returnParameter&quot; Default=&quot;true&quot; Name=&quot;ReadItem&quot; DefaultDisplayName=&quot;Read my claim&quot; /&gt;
              &lt;/MethodInstances&gt;
            &lt;/Method&gt;
            &lt;!-- end specific finder method--&gt;
          &lt;/Methods&gt;
        &lt;/Entity&gt;
      &lt;/Entities&gt;
    &lt;/LobSystem&gt;
  &lt;/LobSystems&gt;
&lt;/Model&gt;
</pre>
<p>After deploying a solution containing these artifacts, you should be able to see the model in Central Administration, if you provider the appropriate permissions to the model in Certral Administration the model should work just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/displaying-personal-session-claims-in-sharepoint-2010-with-bcs/feed/</wfw:commentRss>
		<slash:comments>153</slash:comments>
		</item>
		<item>
		<title>Populating SharePoint picker entity with additional attributes</title>
		<link>http://shojeeb.com/sharepoint/populating-sharepoint-picker-entity-with-additional-attributes/</link>
		<comments>http://shojeeb.com/sharepoint/populating-sharepoint-picker-entity-with-additional-attributes/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 04:11:10 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Claim Provider]]></category>
		<category><![CDATA[Claims]]></category>
		<category><![CDATA[People Picker]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=73</guid>
		<description><![CDATA[When granting permission to an individual or a group within SharePoint 2010 picker picker is used to identify then pick the person or group. Identifying is based on the display text shown to the user in a table format. This display text may not be enough for the user to identify the person correctly. This [...]]]></description>
			<content:encoded><![CDATA[<p>When granting permission to an individual or a group within SharePoint 2010 picker picker is used to identify then pick the person or group. Identifying is based on the display text shown to the user in a table format. This display text may not be enough for the user to identify the person correctly. This is when the list view of the people picker could be used to distinguish the picker entities a bit more. This requires filling in additional attribute values when generating picker entity from SPClaimProvider.</p>
<p>Details vs List View :</p>
<p><a href="http://shojeeb.com/wp-content/uploads/2010/04/sp-picker-entity12.png"><img class="alignleft size-medium wp-image-91" title="sp-picker-entity1" src="http://shojeeb.com/wp-content/uploads/2010/04/sp-picker-entity12-300x266.png" alt="" width="300" height="266" /></a></p>
<p><a href="http://shojeeb.com/wp-content/uploads/2010/04/sp-picker-entity22.png"><img class="size-medium wp-image-90 alignnone" title="sp-picker-entity2" src="http://shojeeb.com/wp-content/uploads/2010/04/sp-picker-entity22-300x266.png" alt="" width="300" height="266" /></a></p>
<p>Above picture show the email address field filled in during picker entity creation from SPClaims provider. This is infact very easy to do. Here is how, i will provide code snippet for both a User entity and Group entity.</p>
<p>For User picker entities,</p>
<pre name="code" class="c-sharp">
    private PickerEntity CreatePickerEntityFromUserProfile(UserProfile profile)
    {
        PickerEntity entity = CreatePickerEntity();
        entity.Key = profile.PrincipalName;
        entity.DisplayText = profile.Fullname;
        entity.Description = profile.PrincipalName;
        if (string.IsNullOrEmpty(entity.DisplayText))
        {
            entity.DisplayText = profile.PrincipalName;
        }
        entity.Description = profile.PrincipalName;
        entity.EntityData[UserProfileEntityInfo.PrincipalName] = profile.PrincipalName;
        entity.EntityData[UserProfileEntityInfo.Forenames] = profile.Forenames;
        entity.EntityData[UserProfileEntityInfo.Surname] = profile.Surname;
        entity.EntityData[UserProfileEntityInfo.PreferedName] = profile.PreferedName;
        entity.EntityData[UserProfileEntityInfo.UPI] = profile.UPI;
        entity.EntityData[UserProfileEntityInfo.PrimaryEmail] = profile.PrimaryEmail;
        entity.EntityData[UserProfileEntityInfo.Fullname] = entity.DisplayText;

        entity.Claim = SPClaimProviderManager.CreateUserClaim(profile.PrincipalName,
            SPOriginalIssuerType.TrustedProvider, trustedProviderName);

        entity.EntityType = OrganisationalEntityTypes.User;
        entity.EntityGroupName = OrganisationalEntityTypes.PeopleGroup;
        entity.IsResolved = true;

        return entity;
    }</pre>
<p>For Group picker entities,</p>
<pre name="code" class="c-sharp">
    private PickerEntity CreatePickerEntityFromContextRole(ContextRole contextGroup)
    {
        PickerEntity entity = CreatePickerEntity();
        entity.Key = contextGroup.ContextRoleName;
        entity.DisplayText = contextGroup.ContextRoleName.ToLower();
        entity.Description = entity.DisplayText;
        entity.EntityData[ContextEntityInfo.Name] = entity.DisplayText;
        entity.EntityData[ContextEntityInfo.PrimaryEmail] = contextGroup.Email;
        entity.EntityData[ContextEntityInfo.DisplayName] = entity.DisplayText;

        if (contextGroup.ContextTypeName == "Stream")
        {
            entity.EntityType = OrganisationalEntityTypes.Stream;
            entity.EntityGroupName = OrganisationalEntityTypes.StreamGroupsGroup;
            entity.Claim = new SPClaim(OrganisationalClaimTypes.StreamRole,
                contextGroup.ContextRoleName, OrganisationalClaimTypes.StreamRoleValueType,
                SPOriginalIssuers.Format(SPOriginalIssuerType.TrustedProvider, trustedProviderName));
        }
        else if (contextGroup.ContextTypeName == "Course")
        {
            entity.EntityType = OrganisationalEntityTypes.Course;
            entity.EntityGroupName = OrganisationalEntityTypes.CourseGroupsGroup;
            entity.Claim = new SPClaim(OrganisationalClaimTypes.CourseRole,
                contextGroup.ContextRoleName, OrganisationalClaimTypes.CourseRoleValueType,
                SPOriginalIssuers.Format(SPOriginalIssuerType.TrustedProvider, trustedProviderName));
        }
        entity.IsResolved = true;
        return entity;
    }</pre>
<p>In the above code snippets, UserProfile and ContextRole are custom classes that hold information about User and Group respectively. You can probably tell this snippet is from a SPClaimProvider specialized for a university, so you don&#8217;t have to use all the attributes only the ones that apply to you organization. <strong>PeopleEditorEntityDataKeys</strong> class has the attribute names that are most often used withing SharePoint. UserProfileEntityInfo and ContextEntityInfo hold string constants specifying the additional column names.</p>
<pre name="code" class="c-sharp">
    public class UserProfileEntityInfo
    {
        public const string PrincipalName = "Principal Name";
        public const string Forenames = "Forenames";
        public const string Surname = "Surname";
        public const string PreferedName = "Prefered Name";
        public const string UPI = "UPI";
        public static string Fullname
        {
            get
            {
                return PeopleEditorEntityDataKeys.DisplayName;
            }
        }

        public static string PrimaryEmail
        {
            get
            {
                return PeopleEditorEntityDataKeys.Email;
            }
        }
    }

    public class ContextEntityInfo
    {
        public static string Name
        {
            get
            {
                return "Context Name";
            }
        }

        public static string DisplayName
        {
            get
            {
                return PeopleEditorEntityDataKeys.DisplayName;
            }
        }

        public static string PrimaryEmail
        {
            get
            {
                return PeopleEditorEntityDataKeys.Email;
            }
        }
    }</pre>
<p>There are couple of additional benefits to specifying these attributes. Apart from macking user and group identification easy, it lets any custom code which requires people picker to be able to use these additional attributes in its code in an implementation independent way, which is always a very good thing to do while designing new functionality. Second benefit is in regard to groups. I haven&#8217;t been able to create custom profiles for groups, however the only profile functionality i wanted for groups is email attribute. If we populate our picker entities during permission granting SharePoint will copy this email address and store it in the site collection. Thus If you did grant permissions to a group and someone wanted to send an email to this group, this is the email address that would be used. We use a distribution list email per group to full fill this requirement. Btw, if anyone else have another way of doing this please let me know, always keen to learn.</p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/populating-sharepoint-picker-entity-with-additional-attributes/feed/</wfw:commentRss>
		<slash:comments>120</slash:comments>
		</item>
		<item>
		<title>Custom SPClaimsProvider for SPTrustedIdentityTokenIssuer</title>
		<link>http://shojeeb.com/sharepoint/custom-spclaimsprovider-for-sptrustedidentitytokenissuer-in-sharepoint-2010/</link>
		<comments>http://shojeeb.com/sharepoint/custom-spclaimsprovider-for-sptrustedidentitytokenissuer-in-sharepoint-2010/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 02:32:29 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Claim Provider]]></category>
		<category><![CDATA[Claims]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=58</guid>
		<description><![CDATA[After you have configured a SPTrustedIdentityTokenIssuer in your farm and enabled this provider as an authentication provider for a web application you should be able to see this provider in people picker as a top level node. You might be a little disappointed at this stage if you tried to search anything in the picker. Any text [...]]]></description>
			<content:encoded><![CDATA[<p>After you have configured a SPTrustedIdentityTokenIssuer in your farm and enabled this provider as an authentication provider for a web application you should be able to see this provider in people picker as a top level node. You might be a little disappointed at this stage if you tried to search anything in the picker. Any text you enter always get resolved by the provider that you just configured. This is because SPTrustedIdentityTokenIssuer by default has its own claim provider that is quite basic in its functionality. It accepts any text entered by the user as it is unaware of the attribute source of your SPTrustedIdentityTokenIssuer.</p>
<p>This basic functionality might be good enough in certain scenarios but is not the greatest when it comes to user feedback and is very vulnerable to typos. This is why SPTrustedIdentityTokenIssuer can be configured with a custom SPClaimsProvider. Instructions on how to create SPClaimProvider can be found at <a href="http://blogs.technet.com/speschka/">http://blogs.technet.com/speschka/</a> . I have created one for our organization, if anyone needs additional code examples please leave a comment and i will try putting a post on how to create it in more detail. After you have created a claim provider you can configure it for trusted identity token issuer from code as follows. Here <strong>loginProviderName </strong>is the name of the SPTrustedIdentityTokenIssuer that you have configured earlier and <strong>claimProviderName </strong>is the name of the SPClaimProvider.</p>
<pre name="code" class="csharp">
SPSecurityTokenServiceManager stsManager = SPSecurityTokenServiceManager.Local;
SPTrustedLoginProviderCollection loginProviders = stsManager.TrustedLoginProviders;
SPTrustedLoginProvider loginProvider = loginProviders.GetProviderByName(loginProviderName);
loginProvider.ClaimProviderName = claimProviderName;
loginProvider.Update();
</pre>
<p>Or from SharePoint 2010  powsershell as follows</p>
<pre name="code" class="csharp">
Set-SPTrustedIdentityTokenIssuer -Identity $loginProviderName -ClaimProvider $claimProviderName
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/custom-spclaimsprovider-for-sptrustedidentitytokenissuer-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>164</slash:comments>
		</item>
		<item>
		<title>Custom sign in page URL for SharePoint &#8211; quick way</title>
		<link>http://shojeeb.com/sharepoint/custom-sign-in-page-url-for-sharepoint-quick-way/</link>
		<comments>http://shojeeb.com/sharepoint/custom-sign-in-page-url-for-sharepoint-quick-way/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 08:42:41 +0000</pubDate>
		<dc:creator>Zubair Ahmed</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Claims]]></category>

		<guid isPermaLink="false">http://shojeeb.com/?p=31</guid>
		<description><![CDATA[If you have tried to create a SharePoint web application in 2010 with multiple authentication providers you might have felt the need for a custom sign in page. SharePoint 2010 ships with a custom page that contains a drop down and allows the user to select the authentication provider of their choice. This however does [...]]]></description>
			<content:encoded><![CDATA[<p>If you have tried to create a SharePoint web application in 2010 with multiple authentication providers you might have felt the need for a custom sign in page. SharePoint 2010 ships with a custom page that contains a drop down and allows the user to select the authentication provider of their choice. This however does not always meet the need, this is why SharePoint 2010 allows customization of sign in page by specifying the it during authentication provider configuration.</p>
<p>One scenario where this becomes even more important is where you don&#8217;t want to allow users to sign in using Windows Integrated authentication but need to allow it for search indexing purposes. Yes you can create another zone and enable windows authentication on that zone only. This is a possible option but will complicate search indexing.</p>
<p>In a simpler environment there is a simpler option that does not require any custom coding at all. Here is how to do it&#8230; Create a SharePoint Trusted Login Provider. Following links might help you get started with that.</p>
<p><a href="http://blogs.msdn.com/spidentity/archive/2010/01/04/claims-based-authentication-cheat-sheet-part-1.aspx">http://blogs.msdn.com/spidentity/archive/2010/01/04/claims-based-authentication-cheat-sheet-part-1.aspx</a> and <a href="http://blogs.msdn.com/spidentity/archive/2010/01/23/claims-based-authentication-cheat-sheet-part-2.aspx">http://blogs.msdn.com/spidentity/archive/2010/01/23/claims-based-authentication-cheat-sheet-part-2.aspx</a></p>
<p><a href="http://blogs.msdn.com/spidentity/archive/2010/01/04/claims-based-authentication-cheat-sheet-part-1.aspx"></a></p>
<p>Once this is done this will show up in the authentication provider configuration. Here <strong>testconnect </strong>is the name of the Trusted Login Provider.</p>
<p><a href="http://shojeeb.com/wp-content/uploads/2010/04/sp-claims-auth-config1.png"><img class="alignnone size-full wp-image-32" title="sp-claims-auth-config1" src="http://shojeeb.com/wp-content/uploads/2010/04/sp-claims-auth-config1.png" alt="" width="614" height="484" /></a></p>
<p>After creating the Trusted Login Provider simply specify the following URL (adjusting <strong>testconnect </strong>to the name of your login provider).</p>
<p><a href="http://shojeeb.com/wp-content/uploads/2010/04/sp-claims-auth-config2.png"><img class="alignnone size-full wp-image-33" title="sp-claims-auth-config2" src="http://shojeeb.com/wp-content/uploads/2010/04/sp-claims-auth-config2.png" alt="" width="595" height="201" /></a></p>
<p>When authentication is required the user will be redirected to this page which looks at the <strong>trust </strong>parameter in the query string. This parameter is used to automatically redirect the user to the login provider.</p>
<p>This is the quick and dirty way of specifying Sign in page URL. However this is not appropriate for all cases. I will try posting a follow up post that shows how to customize this sign in process a bit more.</p>
]]></content:encoded>
			<wfw:commentRss>http://shojeeb.com/sharepoint/custom-sign-in-page-url-for-sharepoint-quick-way/feed/</wfw:commentRss>
		<slash:comments>115</slash:comments>
		</item>
	</channel>
</rss>

