Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Selectors / WindowsSecurityTokenAuthenticator.cs / 1305376 / WindowsSecurityTokenAuthenticator.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.Collections.Generic; using System.Collections.ObjectModel; using System.IdentityModel.Claims; using System.IdentityModel.Policy; using System.IdentityModel.Tokens; public class WindowsSecurityTokenAuthenticator : SecurityTokenAuthenticator { bool includeWindowsGroups; public WindowsSecurityTokenAuthenticator() : this(WindowsClaimSet.DefaultIncludeWindowsGroups) { } public WindowsSecurityTokenAuthenticator(bool includeWindowsGroups) { this.includeWindowsGroups = includeWindowsGroups; } protected override bool CanValidateTokenCore(SecurityToken token) { return token is WindowsSecurityToken; } protected override ReadOnlyCollectionValidateTokenCore(SecurityToken token) { WindowsSecurityToken windowsToken = (WindowsSecurityToken)token; WindowsClaimSet claimSet = new WindowsClaimSet(windowsToken.WindowsIdentity, windowsToken.AuthenticationType, this.includeWindowsGroups, windowsToken.ValidTo); return SecurityUtils.CreateAuthorizationPolicies(claimSet, windowsToken.ValidTo); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.Collections.Generic; using System.Collections.ObjectModel; using System.IdentityModel.Claims; using System.IdentityModel.Policy; using System.IdentityModel.Tokens; public class WindowsSecurityTokenAuthenticator : SecurityTokenAuthenticator { bool includeWindowsGroups; public WindowsSecurityTokenAuthenticator() : this(WindowsClaimSet.DefaultIncludeWindowsGroups) { } public WindowsSecurityTokenAuthenticator(bool includeWindowsGroups) { this.includeWindowsGroups = includeWindowsGroups; } protected override bool CanValidateTokenCore(SecurityToken token) { return token is WindowsSecurityToken; } protected override ReadOnlyCollection ValidateTokenCore(SecurityToken token) { WindowsSecurityToken windowsToken = (WindowsSecurityToken)token; WindowsClaimSet claimSet = new WindowsClaimSet(windowsToken.WindowsIdentity, windowsToken.AuthenticationType, this.includeWindowsGroups, windowsToken.ValidTo); return SecurityUtils.CreateAuthorizationPolicies(claimSet, windowsToken.ValidTo); } } } // 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
- UIElementIsland.cs
- CodeGenerator.cs
- HostDesigntimeLicenseContext.cs
- storepermission.cs
- RealizedColumnsBlock.cs
- Oid.cs
- EntryPointNotFoundException.cs
- TextProperties.cs
- COMException.cs
- RoleService.cs
- path.cs
- SchemaLookupTable.cs
- SqlDataRecord.cs
- DesignerTextBoxAdapter.cs
- SqlCachedBuffer.cs
- ParserExtension.cs
- SqlConnectionString.cs
- SemaphoreFullException.cs
- Classification.cs
- StructuredType.cs
- WMIInterop.cs
- VirtualDirectoryMapping.cs
- JumpPath.cs
- SortDescription.cs
- ListViewGroupItemCollection.cs
- StrokeDescriptor.cs
- VectorCollection.cs
- TCPListener.cs
- PerformanceCounterNameAttribute.cs
- DataServiceRequest.cs
- MemberAssignmentAnalysis.cs
- SignedXml.cs
- _RequestLifetimeSetter.cs
- SrgsGrammarCompiler.cs
- ContextInformation.cs
- comcontractssection.cs
- ConfigWriter.cs
- ChildrenQuery.cs
- EdmSchemaAttribute.cs
- DataControlFieldTypeEditor.cs
- WebBrowserContainer.cs
- ObjectCacheSettings.cs
- LayoutUtils.cs
- TriggerActionCollection.cs
- GACMembershipCondition.cs
- MbpInfo.cs
- ParenExpr.cs
- WrappedDispatcherException.cs
- HtmlControlPersistable.cs
- SecureStringHasher.cs
- CannotUnloadAppDomainException.cs
- SqlDependency.cs
- AsymmetricAlgorithm.cs
- CorrelationHandle.cs
- XmlILIndex.cs
- GlyphTypeface.cs
- PropertyToken.cs
- LOSFormatter.cs
- HttpRuntime.cs
- Light.cs
- Location.cs
- CompositionDesigner.cs
- CodeTypeDeclaration.cs
- StorageComplexTypeMapping.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- AutomationEventArgs.cs
- InOutArgumentConverter.cs
- SingleAnimationUsingKeyFrames.cs
- OdbcError.cs
- Rectangle.cs
- XmlExpressionDumper.cs
- StatusBarItem.cs
- XXXInfos.cs
- AutomationPropertyInfo.cs
- XmlSerializerVersionAttribute.cs
- InternalMappingException.cs
- SecurityContextTokenValidationException.cs
- METAHEADER.cs
- LinqDataView.cs
- DataException.cs
- DesignerLoader.cs
- TextElement.cs
- WindowsSysHeader.cs
- DataSetMappper.cs
- InfiniteIntConverter.cs
- UInt16.cs
- NoClickablePointException.cs
- SQLDoubleStorage.cs
- ScriptRegistrationManager.cs
- StylusPointDescription.cs
- Tag.cs
- DesignerCategoryAttribute.cs
- DetailsViewModeEventArgs.cs
- ImpersonateTokenRef.cs
- ContextStack.cs
- ComMethodElement.cs
- recordstatescratchpad.cs
- CaretElement.cs
- HyperLinkStyle.cs
- XmlSchemaComplexContentRestriction.cs