Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / SamlSecurityToken.cs / 1305376 / SamlSecurityToken.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; using System.Xml.Serialization; using System.Xml; using System.Xml.Schema; using System.CodeDom; using System.Runtime.Serialization; using System.Globalization; using System.Threading; using System.IdentityModel.Selectors; using System.IdentityModel.Policy; using System.Reflection; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.IO; public class SamlSecurityToken : SecurityToken { SamlAssertion assertion; protected SamlSecurityToken() { } public SamlSecurityToken(SamlAssertion assertion) { Initialize(assertion); } protected void Initialize(SamlAssertion assertion) { if (assertion == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("assertion"); this.assertion = assertion; this.assertion.MakeReadOnly(); } public override string Id { get { return this.assertion.AssertionId; } } public override ReadOnlyCollectionSecurityKeys { get { return this.assertion.SecurityKeys; } } public SamlAssertion Assertion { get { return this.assertion; } } public override DateTime ValidFrom { get { if (this.assertion.Conditions != null) { return this.assertion.Conditions.NotBefore; } return SecurityUtils.MinUtcDateTime; } } public override DateTime ValidTo { get { if (this.assertion.Conditions != null) { return this.assertion.Conditions.NotOnOrAfter; } return SecurityUtils.MaxUtcDateTime; } } public override bool CanCreateKeyIdentifierClause () { if (typeof(T) == typeof(SamlAssertionKeyIdentifierClause)) return true; return false; } public override T CreateKeyIdentifierClause () { if (typeof(T) == typeof(SamlAssertionKeyIdentifierClause)) return new SamlAssertionKeyIdentifierClause(this.Id) as T; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.UnableToCreateTokenReference))); } public override bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) { SamlAssertionKeyIdentifierClause samlKeyIdentifierClause = keyIdentifierClause as SamlAssertionKeyIdentifierClause; if (samlKeyIdentifierClause != null) return samlKeyIdentifierClause.Matches(this.Id); return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpClientCredentialType.cs
- OrthographicCamera.cs
- PropertyNames.cs
- SharedStatics.cs
- WorkflowView.cs
- WinEventTracker.cs
- ProfileParameter.cs
- SQLDateTimeStorage.cs
- ProtocolsConfigurationHandler.cs
- SetterBaseCollection.cs
- WorkflowMarkupSerializationException.cs
- Function.cs
- ConfigXmlSignificantWhitespace.cs
- LayoutEngine.cs
- TrackingServices.cs
- AttachmentCollection.cs
- SchemaDeclBase.cs
- _DomainName.cs
- IndexedString.cs
- DBConnectionString.cs
- LockedAssemblyCache.cs
- MdiWindowListStrip.cs
- SymbolDocumentInfo.cs
- HtmlElementCollection.cs
- GeometryCollection.cs
- RuleSettingsCollection.cs
- EntityDataSourceView.cs
- PixelFormats.cs
- XamlInterfaces.cs
- ShapingEngine.cs
- SqlConnection.cs
- RangeBaseAutomationPeer.cs
- WebControl.cs
- CompilerResults.cs
- ObjectHelper.cs
- DigestComparer.cs
- SchemaDeclBase.cs
- FormatSettings.cs
- ZoneLinkButton.cs
- EnterpriseServicesHelper.cs
- Sentence.cs
- DataBindingCollection.cs
- RangeValueProviderWrapper.cs
- sqlnorm.cs
- StyleSelector.cs
- BinaryObjectWriter.cs
- JobCollate.cs
- TemplateControlBuildProvider.cs
- PassportAuthenticationModule.cs
- SeekStoryboard.cs
- AutomationPeer.cs
- Rotation3D.cs
- ClientUrlResolverWrapper.cs
- ECDsa.cs
- MSHTMLHost.cs
- Scheduler.cs
- ParserStreamGeometryContext.cs
- MaskedTextBox.cs
- Rights.cs
- Int16KeyFrameCollection.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ScriptComponentDescriptor.cs
- SingleAnimation.cs
- FullTrustAssembliesSection.cs
- ListBoxAutomationPeer.cs
- Calendar.cs
- LinqDataSourceEditData.cs
- Clock.cs
- RoleService.cs
- EntityDataSourceValidationException.cs
- ValidationSummary.cs
- AutoSizeToolBoxItem.cs
- Size.cs
- DropDownButton.cs
- AuthenticationConfig.cs
- X509Certificate.cs
- RegistryDataKey.cs
- BlockCollection.cs
- SpeechSeg.cs
- ColorConvertedBitmap.cs
- GlyphElement.cs
- WebEvents.cs
- BitmapMetadata.cs
- XmlSignificantWhitespace.cs
- SoapHeader.cs
- DecimalAnimationUsingKeyFrames.cs
- TemplateInstanceAttribute.cs
- TextWriterTraceListener.cs
- GridItemProviderWrapper.cs
- JsonXmlDataContract.cs
- CodeArrayIndexerExpression.cs
- InfoCardClaim.cs
- DropTarget.cs
- XmlWriterSettings.cs
- SemaphoreFullException.cs
- SemanticTag.cs
- ResXResourceWriter.cs
- InvokeHandlers.cs
- EntityViewGenerator.cs
- XPathExpr.cs