Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / PassportAuthentication.cs / 2 / PassportAuthentication.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /***************************************************************************** From machine.config******************************************************************************/ namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Web.Util; using System.ComponentModel; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PassportAuthentication : ConfigurationElement { private static readonly ConfigurationElementProperty s_elemProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(PassportAuthentication), Validate)); private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propRedirectUrl = new ConfigurationProperty("redirectUrl", typeof(string), "internal", ConfigurationPropertyOptions.None); static PassportAuthentication() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propRedirectUrl); } public PassportAuthentication() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("redirectUrl", DefaultValue = "internal")] [StringValidator()] public string RedirectUrl { get { return (string)base[_propRedirectUrl]; } set { base[_propRedirectUrl] = value; } } protected override ConfigurationElementProperty ElementProperty { get { return s_elemProperty; } } private static void Validate(object value) { if (value == null) { throw new ArgumentNullException("passport"); } Debug.Assert(value is PassportAuthentication); PassportAuthentication elem = (PassportAuthentication)value; if (StringUtil.StringStartsWith(elem.RedirectUrl, "\\\\") || (elem.RedirectUrl.Length > 1 && elem.RedirectUrl[1] == ':')) { throw new ConfigurationErrorsException(SR.GetString(SR.Auth_bad_url)); } } } // class PassportAuthentication }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- COM2EnumConverter.cs
- CompilerWrapper.cs
- NativeMethods.cs
- TrackingServices.cs
- RowParagraph.cs
- AffineTransform3D.cs
- FtpRequestCacheValidator.cs
- ReflectionHelper.cs
- InputMethodStateTypeInfo.cs
- WorkflowRuntimeEndpoint.cs
- AxImporter.cs
- TagPrefixInfo.cs
- PTConverter.cs
- SecurityContext.cs
- OdbcInfoMessageEvent.cs
- SecurityIdentifierElement.cs
- SimpleType.cs
- MenuItemBindingCollection.cs
- XmlEnumAttribute.cs
- Itemizer.cs
- SemaphoreSecurity.cs
- ByteStack.cs
- SqlVisitor.cs
- BaseHashHelper.cs
- Misc.cs
- PreviewKeyDownEventArgs.cs
- NetTcpSecurityElement.cs
- PropertyStore.cs
- UidPropertyAttribute.cs
- StyleCollection.cs
- WindowsButton.cs
- MenuItemStyleCollection.cs
- TextDecorationCollection.cs
- ToolStripContainer.cs
- ReadOnlyDictionary.cs
- CustomAttributeFormatException.cs
- DomainConstraint.cs
- Rectangle.cs
- MessageDecoder.cs
- FirstMatchCodeGroup.cs
- HandlerBase.cs
- CodeSubDirectory.cs
- WebControlAdapter.cs
- HttpWebRequestElement.cs
- RuntimeCompatibilityAttribute.cs
- UriTemplateTrieLocation.cs
- InvalidCommandTreeException.cs
- WmlLinkAdapter.cs
- GridViewEditEventArgs.cs
- SafeNativeMethods.cs
- JavaScriptObjectDeserializer.cs
- KeySplineConverter.cs
- WindowProviderWrapper.cs
- M3DUtil.cs
- WizardStepBase.cs
- PersonalizationStateQuery.cs
- HttpDebugHandler.cs
- UnknownBitmapEncoder.cs
- XamlReaderHelper.cs
- CompositeCollection.cs
- Wildcard.cs
- _BufferOffsetSize.cs
- UIPermission.cs
- ProviderCollection.cs
- FormViewInsertedEventArgs.cs
- DataGridViewHitTestInfo.cs
- Application.cs
- ElementProxy.cs
- ServiceDescriptions.cs
- HwndStylusInputProvider.cs
- DragCompletedEventArgs.cs
- UIInitializationException.cs
- WindowsServiceElement.cs
- ClipboardProcessor.cs
- DatatypeImplementation.cs
- BuilderPropertyEntry.cs
- BinHexDecoder.cs
- JournalEntry.cs
- OpenTypeCommon.cs
- TemplatePartAttribute.cs
- CacheForPrimitiveTypes.cs
- RoutedEventHandlerInfo.cs
- XmlSchemaObjectCollection.cs
- EntityConnectionStringBuilder.cs
- DataGridViewDataConnection.cs
- WorkflowApplicationAbortedEventArgs.cs
- CounterCreationDataCollection.cs
- RtfToken.cs
- ProfileBuildProvider.cs
- ToolBar.cs
- OleDbError.cs
- XmlRootAttribute.cs
- CroppedBitmap.cs
- RuntimeArgumentHandle.cs
- ControlEvent.cs
- BooleanFunctions.cs
- NullableConverter.cs
- ToolStripRendererSwitcher.cs
- SvcMapFileLoader.cs
- ControlUtil.cs