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
- XmlNavigatorStack.cs
- UInt64Converter.cs
- WSDualHttpSecurityMode.cs
- Literal.cs
- CodeIdentifier.cs
- MissingMethodException.cs
- XmlValidatingReaderImpl.cs
- XamlTreeBuilder.cs
- EDesignUtil.cs
- AssemblyResourceLoader.cs
- OledbConnectionStringbuilder.cs
- ControllableStoryboardAction.cs
- SpellerInterop.cs
- TypedReference.cs
- DataFormats.cs
- JapaneseLunisolarCalendar.cs
- MemberMemberBinding.cs
- GroupByQueryOperator.cs
- EventBuilder.cs
- XmlSchemaAnyAttribute.cs
- WebConfigurationHostFileChange.cs
- Model3DCollection.cs
- DashStyle.cs
- TabControlEvent.cs
- CancelEventArgs.cs
- SoundPlayerAction.cs
- ImportCatalogPart.cs
- WindowInteractionStateTracker.cs
- FactoryId.cs
- CheckedListBox.cs
- TabPage.cs
- SafeReversePInvokeHandle.cs
- EnumCodeDomSerializer.cs
- TableParagraph.cs
- VirtualPathProvider.cs
- LinqTreeNodeEvaluator.cs
- HitTestParameters.cs
- Lazy.cs
- SizeAnimation.cs
- sqlstateclientmanager.cs
- SplineKeyFrames.cs
- FixedPageStructure.cs
- Closure.cs
- ReferenceService.cs
- PointAnimationUsingKeyFrames.cs
- ClientTarget.cs
- ArraySortHelper.cs
- GenericTransactionFlowAttribute.cs
- AssociativeAggregationOperator.cs
- ProfilePropertyNameValidator.cs
- InternalConfigEventArgs.cs
- ClientOptions.cs
- DoubleCollectionConverter.cs
- LinqDataSourceDisposeEventArgs.cs
- VectorCollection.cs
- MatrixAnimationUsingPath.cs
- LoginDesignerUtil.cs
- HwndStylusInputProvider.cs
- FontStretches.cs
- CopyAction.cs
- _TLSstream.cs
- RelationshipEndMember.cs
- SHA256Managed.cs
- SqlConnection.cs
- DataGridViewRowsRemovedEventArgs.cs
- BindingGroup.cs
- ChangeDirector.cs
- CategoryAttribute.cs
- StringUtil.cs
- DoWorkEventArgs.cs
- Region.cs
- PolicyAssertionCollection.cs
- ConfigurationStrings.cs
- LineBreak.cs
- ValidationHelpers.cs
- VirtualizingPanel.cs
- SqlStatistics.cs
- DrawTreeNodeEventArgs.cs
- DataGridViewUtilities.cs
- MenuItemStyleCollection.cs
- SingleSelectRootGridEntry.cs
- DropSource.cs
- GifBitmapDecoder.cs
- BasicAsyncResult.cs
- BreadCrumbTextConverter.cs
- ToggleButtonAutomationPeer.cs
- ListView.cs
- SqlDependency.cs
- TextTreeExtractElementUndoUnit.cs
- SqlFlattener.cs
- TextRangeProviderWrapper.cs
- XmlHierarchicalDataSourceView.cs
- SqlDataSourceEnumerator.cs
- XmlByteStreamReader.cs
- RootProfilePropertySettingsCollection.cs
- Walker.cs
- SafeEventHandle.cs
- DataSourceSelectArguments.cs
- PropertyMapper.cs
- TextOnlyOutput.cs