TokenFactoryFactory.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / TokenFactoryFactory.cs / 1 / TokenFactoryFactory.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards
{ 
    using System;
    using System.Security.Cryptography.X509Certificates; 
    using System.ServiceModel; 
    using System.ServiceModel.Description;
    using System.Net; 

    //
    // Summary:
    //  Factory class for creating instances of ITokenFactoy impementations. 
    //
    internal sealed class TokenFactoryFactory 
    { 
        private TokenFactoryFactory(){}
 

        //
        // Summary:
        //  Creates a token factroy from the infocard and create info. 
        //
        // Arguments: 
        //  connection: The StoreConnection info that can be queried 
        //  infoCard:   The Card that was selected to be used.
        //  parameter:  The current creation parameters for the selected card. 
        //  proxy:      The proxy data for the user
        //
        public static ITokenFactory Create(
                                            InfoCard infoCard, 
                                            TokenCreationParameter parameter,
                                            ServiceEndpoint endPoint, 
                                            IWebProxy proxy ) 
        {
            ITokenFactory factory = null; 

            //
            // Self issued only allows for SamlTokens.
            // 
            if( infoCard.IsSelfIssued )
            { 
                factory = new SelfIssuedSamlTokenFactory( ); 
            }
            else 
            {
                factory = new RemoteTokenFactory( endPoint, proxy );
            }
 
            return factory;
        } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK