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
- ClientUrlResolverWrapper.cs
- LogicalTreeHelper.cs
- PolyBezierSegmentFigureLogic.cs
- HealthMonitoringSection.cs
- BrowserCapabilitiesFactory.cs
- MarkupCompiler.cs
- WindowsListViewItemCheckBox.cs
- StretchValidation.cs
- CapabilitiesUse.cs
- Package.cs
- PublisherMembershipCondition.cs
- ChtmlSelectionListAdapter.cs
- DesignerHierarchicalDataSourceView.cs
- ExtensionDataObject.cs
- FastPropertyAccessor.cs
- CodeComment.cs
- CodeArrayIndexerExpression.cs
- TraceRecord.cs
- XLinq.cs
- MobileSysDescriptionAttribute.cs
- CreatingCookieEventArgs.cs
- Int32Rect.cs
- DockEditor.cs
- AssemblyContextControlItem.cs
- Trigger.cs
- FacetChecker.cs
- ActivityCodeDomSerializer.cs
- VirtualPath.cs
- GeometryDrawing.cs
- WebPartDescription.cs
- PackagePartCollection.cs
- XmlArrayItemAttributes.cs
- TabControlToolboxItem.cs
- SinglePageViewer.cs
- WebEvents.cs
- URI.cs
- SecureUICommand.cs
- RegistrationServices.cs
- _Connection.cs
- Point3DConverter.cs
- SafePointer.cs
- WebControlParameterProxy.cs
- _SSPISessionCache.cs
- LinqDataSourceDeleteEventArgs.cs
- SafeTimerHandle.cs
- DataGridViewCellConverter.cs
- WebPartDescription.cs
- PageThemeParser.cs
- StorageInfo.cs
- ObjectSpanRewriter.cs
- SqlSupersetValidator.cs
- SymLanguageType.cs
- GatewayIPAddressInformationCollection.cs
- List.cs
- ReturnValue.cs
- GenericXmlSecurityToken.cs
- OdbcPermission.cs
- GenericEnumConverter.cs
- PresentationAppDomainManager.cs
- CuspData.cs
- CustomAttributeFormatException.cs
- Helper.cs
- Array.cs
- RoleManagerSection.cs
- SoapHeaders.cs
- MimeTypeAttribute.cs
- ObjectStateFormatter.cs
- ContextBase.cs
- Crypto.cs
- ISFClipboardData.cs
- Button.cs
- AuthenticateEventArgs.cs
- WebEventCodes.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- AnimationTimeline.cs
- PageOutputQuality.cs
- RenderingBiasValidation.cs
- CommandBinding.cs
- CustomErrorsSectionWrapper.cs
- IncrementalReadDecoders.cs
- MatrixAnimationUsingKeyFrames.cs
- ExtendedPropertyInfo.cs
- Clock.cs
- TryExpression.cs
- UpdateManifestForBrowserApplication.cs
- DesignerForm.cs
- AuthenticationService.cs
- UiaCoreApi.cs
- InputBuffer.cs
- ObjectSecurity.cs
- MediaCommands.cs
- ProfileService.cs
- DnsEndpointIdentity.cs
- HandledMouseEvent.cs
- SimplePropertyEntry.cs
- COM2Enum.cs
- EventLogger.cs
- BitSet.cs
- ValidatingCollection.cs
- RemotingConfiguration.cs