Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Selectors / UserNamePasswordValidator.cs / 1305376 / UserNamePasswordValidator.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.IdentityModel.Tokens; using System.Web.Security; public abstract class UserNamePasswordValidator { static UserNamePasswordValidator none; public static UserNamePasswordValidator None { get { if (none == null) none = new NoneUserNamePasswordValidator(); return none; } } public static UserNamePasswordValidator CreateMembershipProviderValidator(MembershipProvider provider) { if (provider == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("provider"); return new MembershipProviderValidator(provider); } public abstract void Validate(string userName, string password); class NoneUserNamePasswordValidator : UserNamePasswordValidator { public override void Validate(string userName, string password) { } } class MembershipProviderValidator : UserNamePasswordValidator { MembershipProvider provider; public MembershipProviderValidator(MembershipProvider provider) { this.provider = provider; } public override void Validate(string userName, string password) { if (!this.provider.ValidateUser(userName, password)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException( SR.GetString(SR.UserNameAuthenticationFailed, this.provider.GetType().Name))); } } } } } // 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
- ServiceDescription.cs
- RowUpdatingEventArgs.cs
- SerializationFieldInfo.cs
- FtpWebRequest.cs
- AutoFocusStyle.xaml.cs
- WebZone.cs
- WebPartConnectionsCloseVerb.cs
- PartialList.cs
- RequiredAttributeAttribute.cs
- DataView.cs
- ToolStripGrip.cs
- FileCodeGroup.cs
- XmlSchemaGroupRef.cs
- RawStylusSystemGestureInputReport.cs
- CodeExpressionRuleDeclaration.cs
- ValidatedControlConverter.cs
- MarginCollapsingState.cs
- LinqDataSourceEditData.cs
- Int32Storage.cs
- TypeTypeConverter.cs
- WindowsListViewScroll.cs
- ProcessHostConfigUtils.cs
- ReliableChannelListener.cs
- ReferenceCountedObject.cs
- Funcletizer.cs
- EventLogEntryCollection.cs
- Merger.cs
- _PooledStream.cs
- WebBrowserBase.cs
- CaseInsensitiveComparer.cs
- MethodAccessException.cs
- CorrelationQueryBehavior.cs
- Hashtable.cs
- MatrixUtil.cs
- webproxy.cs
- WbmpConverter.cs
- MarkedHighlightComponent.cs
- SerializationInfo.cs
- DataProtection.cs
- EmptyStringExpandableObjectConverter.cs
- _Events.cs
- ClassHandlersStore.cs
- PropertySourceInfo.cs
- TextParentUndoUnit.cs
- InputLanguageProfileNotifySink.cs
- ObjectDataSourceChooseMethodsPanel.cs
- TextElementAutomationPeer.cs
- RotateTransform3D.cs
- DataGridViewRowCancelEventArgs.cs
- _ChunkParse.cs
- BitmapEffectrendercontext.cs
- NameService.cs
- FileDialogCustomPlace.cs
- DbUpdateCommandTree.cs
- DSACryptoServiceProvider.cs
- RSAPKCS1SignatureDeformatter.cs
- RC2.cs
- webeventbuffer.cs
- SortedDictionary.cs
- ListCollectionView.cs
- DataMember.cs
- DataGridCaption.cs
- HMACSHA1.cs
- RouteParameter.cs
- WebEventTraceProvider.cs
- EventLogPermissionAttribute.cs
- HandleCollector.cs
- ArrayElementGridEntry.cs
- MetadataArtifactLoaderCompositeFile.cs
- AccessedThroughPropertyAttribute.cs
- RankException.cs
- EntityParameterCollection.cs
- BuilderInfo.cs
- ProvidersHelper.cs
- xmlfixedPageInfo.cs
- ReadOnlyCollection.cs
- TextEffectResolver.cs
- Rect.cs
- EntityDataReader.cs
- SyndicationDeserializer.cs
- shaperfactory.cs
- SqlDataSourceQueryConverter.cs
- CodeDomLocalizationProvider.cs
- FloatUtil.cs
- ContextBase.cs
- Rect.cs
- Image.cs
- DataBoundControlActionList.cs
- MapPathBasedVirtualPathProvider.cs
- MessageRpc.cs
- CalendarAutoFormatDialog.cs
- AttachedAnnotation.cs
- SerializationInfoEnumerator.cs
- CapabilitiesAssignment.cs
- FunctionDetailsReader.cs
- XmlSerializationWriter.cs
- SchemaComplexType.cs
- InvalidDataException.cs
- TrackingMemoryStream.cs
- Number.cs