Sergey Shishkin

on agile software development

CardSpace SDK: Creating Managed Cards, Part 3

One more sample from the upcoming SDK:

Using the Configuration

To simplify the process of the creation of information cards and to increase the maintenance capabilities of applications the Information Card API provides support for the .NET Configuration. The <cardSpace> configuration section and the <newCard> configuration element can be used to predefine the information card’s properties in the application configuration file. The call to the static InformationCard.Create method will return then a new information card based on the predefined values.

Source Code




            language ="en-US"

            cardId =""

            cardVersion ="2"

            cardName ="newtelligence"

            cardImage ="card.png"

            issuer =""

            timeExpires ="2008-01-01"

            requireAppliesTo ="false"




                    uri =""

                    mex =""



                        storeLocation ="LocalMachine"

                        storeName ="My"

                        findType ="FindBySubjectName"

                        findValue =""


                    <usernamePasswordCredential />





                    id =""

                    displayTag ="Last Name"

                    description ="Surname or family name of a subject"



                    id =""

                    displayTag ="Custom Claim"

                    description ="This is a custom claim"




                <add type ="urn:oasis:names:tc:SAML:1.0:assertion" />



                location =""

                version ="3"



                storeLocation ="LocalMachine"

                storeName ="My"

                findType ="FindBySubjectName"

                findValue =""





    // Create a new card using config settings

    InformationCard card = InformationCard.Create();


    // Set the actual CardId based on the config settings

    card.CardId = new Uri(card.CardId, "1");


    // Set the Username property for the UserCredential object

    TokenServiceReference service = card.TokenServices[0];

    UsernamePasswordCredential credential =


    credential.Username = "bob";




Written by Sergey Shishkin

08.05.2007 at 09:51

Posted in Uncategorized

%d bloggers like this: