Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / TokenFactoryBase.cs / 1 / TokenFactoryBase.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards
{
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Security;
using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace;
//
// Summary:
// Base implementation of ITokenFactory.
//
internal abstract class TokenFactoryBase : ITokenFactory
{
bool m_aborted;
public bool IsAborted
{
get{ return m_aborted; }
}
//
// Summary:
// Base CTOR for all derived classes
//
protected TokenFactoryBase()
{
}
//
// Summary:
// Creates a TokenDescriptor object for the specified recipient.
//
// Params:
// infoCard: The infocard that the token will be generated from.
// credential: The credential object used to autenticate/authorize with a token factory.
// policy: Specifies the policy of the relying party or identity provider.
// discloseOptional: Specifies whether optional claims are to be disclosed.
//
public TokenDescriptor CreateToken(
InfoCard infoCard,
TokenFactoryCredential credential,
InfoCardPolicy policy,
bool discloseOptional )
{
TokenCreationParameter param = null;
//
// If credentials where provided, and the credential used a param, get the param.
//
if( null != credential && TokenFactoryCredential.NoCredential != credential.ParameterIndex )
{
param = infoCard.CreationParameters[ credential.ParameterIndex ];
}
return ProduceToken( infoCard, param, credential, policy, discloseOptional );
}
public void Abort()
{
OnAbort();
m_aborted = true;
}
//
// Summary:
// Derived class entrypoint. Implementers must implement this method.
//
protected abstract TokenDescriptor ProduceToken(
InfoCard card,
TokenCreationParameter parameters,
TokenFactoryCredential credential,
InfoCardPolicy policy,
bool discloseOptional );
//
// Overide when aborting the token creation.
//
protected virtual void OnAbort()
{
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EdmConstants.cs
- BindingCollectionElement.cs
- ValueCollectionParameterReader.cs
- ListBox.cs
- CharUnicodeInfo.cs
- HtmlInputControl.cs
- XmlNavigatorFilter.cs
- SettingsContext.cs
- PolygonHotSpot.cs
- StoragePropertyMapping.cs
- PermissionListSet.cs
- CustomErrorCollection.cs
- WindowVisualStateTracker.cs
- ImageCollectionCodeDomSerializer.cs
- XmlTextWriter.cs
- DLinqDataModelProvider.cs
- XmlObjectSerializer.cs
- ObjectReaderCompiler.cs
- ListenerElementsCollection.cs
- ArgumentValue.cs
- ClientOperation.cs
- LocalFileSettingsProvider.cs
- LambdaCompiler.Expressions.cs
- DelegatedStream.cs
- SHA256CryptoServiceProvider.cs
- _NegotiateClient.cs
- LoadedOrUnloadedOperation.cs
- XPathAncestorQuery.cs
- TypeBuilder.cs
- EventListener.cs
- CodeDomSerializerException.cs
- OdbcParameter.cs
- sqlinternaltransaction.cs
- DataGridViewSortCompareEventArgs.cs
- PtsPage.cs
- ItemDragEvent.cs
- SecurityException.cs
- HyperLinkStyle.cs
- ButtonBase.cs
- TextLineResult.cs
- HttpHandlerActionCollection.cs
- PtsHost.cs
- ApplyImportsAction.cs
- SymbolEqualComparer.cs
- Storyboard.cs
- _NegoState.cs
- Oid.cs
- RegexGroup.cs
- DataGridPreparingCellForEditEventArgs.cs
- RootBrowserWindowProxy.cs
- RemoteCryptoRsaServiceProvider.cs
- DataGridViewCellConverter.cs
- XmlSchemaNotation.cs
- AudioLevelUpdatedEventArgs.cs
- ProfileService.cs
- SplitterCancelEvent.cs
- Internal.cs
- TokenCreationException.cs
- NetDataContractSerializer.cs
- TypeRestriction.cs
- LayoutExceptionEventArgs.cs
- TextDecorationCollectionConverter.cs
- MediaSystem.cs
- ComplexBindingPropertiesAttribute.cs
- SamlNameIdentifierClaimResource.cs
- ProtocolsSection.cs
- CodeGotoStatement.cs
- WindowsListViewGroup.cs
- Evidence.cs
- TaiwanLunisolarCalendar.cs
- messageonlyhwndwrapper.cs
- PrinterSettings.cs
- WebBrowser.cs
- ProtocolInformationWriter.cs
- RemoveStoryboard.cs
- HtmlObjectListAdapter.cs
- CopyCodeAction.cs
- SingleSelectRootGridEntry.cs
- ComNativeDescriptor.cs
- TextTreeRootTextBlock.cs
- DesignOnlyAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- CodeEntryPointMethod.cs
- SatelliteContractVersionAttribute.cs
- TextContainerChangedEventArgs.cs
- XhtmlBasicValidationSummaryAdapter.cs
- COM2ColorConverter.cs
- DataRowChangeEvent.cs
- EmptyEnumerator.cs
- ArraySegment.cs
- ClientFactory.cs
- GlobalizationAssembly.cs
- ipaddressinformationcollection.cs
- AudioSignalProblemOccurredEventArgs.cs
- BuildDependencySet.cs
- PackagePartCollection.cs
- SystemShuttingDownException.cs
- GeometryModel3D.cs
- ContextMarshalException.cs
- StorageEndPropertyMapping.cs