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
- __Error.cs
- WebPartUtil.cs
- PageParserFilter.cs
- Operand.cs
- LineServices.cs
- SqlCharStream.cs
- SqlParameterCollection.cs
- DetailsViewPageEventArgs.cs
- MSG.cs
- GridViewColumnCollection.cs
- ScalarType.cs
- ButtonChrome.cs
- ScriptingWebServicesSectionGroup.cs
- PrimitiveDataContract.cs
- SafeIUnknown.cs
- DataReaderContainer.cs
- Int16Animation.cs
- ApplicationSecurityInfo.cs
- MarkupCompilePass1.cs
- DataProtection.cs
- BreadCrumbTextConverter.cs
- DataGridViewCellCancelEventArgs.cs
- HttpDebugHandler.cs
- CompatibleComparer.cs
- EventBuilder.cs
- Point4D.cs
- Stacktrace.cs
- XPathPatternBuilder.cs
- DataGridViewElement.cs
- ExpressionBuilder.cs
- WebScriptMetadataInstanceContextProvider.cs
- XsdValidatingReader.cs
- NativeCompoundFileAPIs.cs
- OdbcCommandBuilder.cs
- DataRecordInfo.cs
- NamedPipeTransportSecurity.cs
- HttpPostServerProtocol.cs
- RequestCachePolicyConverter.cs
- MergeFailedEvent.cs
- WindowsFormsSectionHandler.cs
- TableStyle.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- Typeface.cs
- SqlGenericUtil.cs
- XmlAttributeAttribute.cs
- recordstatescratchpad.cs
- ConnectionConsumerAttribute.cs
- OdbcErrorCollection.cs
- FlowLayout.cs
- Function.cs
- CalendarDay.cs
- SqlTypeConverter.cs
- WorkflowPersistenceService.cs
- PackWebRequestFactory.cs
- DataReaderContainer.cs
- TemplatedMailWebEventProvider.cs
- RegistryDataKey.cs
- HttpResponseHeader.cs
- SourceFileInfo.cs
- RectAnimation.cs
- DayRenderEvent.cs
- WindowsAuthenticationEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- DbMetaDataFactory.cs
- PasswordBoxAutomationPeer.cs
- IncrementalHitTester.cs
- Slider.cs
- IndexedEnumerable.cs
- SmiTypedGetterSetter.cs
- ObjectHelper.cs
- DeclarativeCatalogPart.cs
- LongMinMaxAggregationOperator.cs
- BlockUIContainer.cs
- TextAdaptor.cs
- DeviceContext.cs
- ArrayTypeMismatchException.cs
- CompressStream.cs
- WebDescriptionAttribute.cs
- OdbcRowUpdatingEvent.cs
- ContainerAction.cs
- DocumentGridPage.cs
- LambdaCompiler.Address.cs
- HttpDebugHandler.cs
- HttpInputStream.cs
- Triplet.cs
- Internal.cs
- FontSizeConverter.cs
- _TransmitFileOverlappedAsyncResult.cs
- ExcCanonicalXml.cs
- SectionUpdates.cs
- PaperSize.cs
- TabItemWrapperAutomationPeer.cs
- MessageBuffer.cs
- DefaultAssemblyResolver.cs
- DesignerListAdapter.cs
- MethodBuilderInstantiation.cs
- MessageTransmitTraceRecord.cs
- ResourceExpressionBuilder.cs
- DataSourceXmlTextReader.cs
- CapiSafeHandles.cs